DEV Community

loading...

Discussion on: Network-aware Preloading Strategy for Angular Lazy Loading

Collapse
lacolaco profile image
Suguru Inatomi Author

yes, I sometimes use it to prevent reusing compoments by router.
Reusing is for good user experience by transition quickly. But it makes component's state more complex. Components need to be initialized not ngOnInit but on route change.

In my opinion, for component's maintainability, sometimes it may be reasonable that stops reusing.

Collapse
maktarsis profile image
Max Tarsis

Are you talking about more a deep level of maintainability?
I mean there is no difference inside component depending on the route reuse strategy.

I have just heard only that router caches some component's data and after the navigation, it leaves detached nodes.

And as you said above, sometimes we don't need it, so it's good that we have a possibility to simplify the flow