DEV Community

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

Collapse
 
kioviensis profile image
Max Tarsis • Edited

Awesome!
A good usage example of that strategy

Btw, have you heard about RouteReuseStrategy?
Do you have some useful (real-world) examples when we may need to customize it?

Collapse
 
lacolaco profile image
Suguru Inatomi

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
 
kioviensis 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