To be able to lazy-load sub states at runtime #2071
Unanswered
artbat
asked this question in
RFC & Proposals
Replies: 1 comment 3 replies
-
There are also some other options too like Dynamically loading of parent state, Dependency injections and state path resolution. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Description
Currently we can lazy-load "root" states at runtime and we can add sub-states at compile time, but we can't lazy-load sub-states at runtime.
Describe the problem you are trying to solve
We might design a store graph for a set of applications (micro frontends or separate SPAs that might eventually become MFs) where each one would manage only a given graph subset if loaded.
In order to avoid MFs collisions and to reduce cognitive load, it'd be very convenient to design the applications graph and the Store's graph in parallel:
But this isn't possible currently, as we can only lazy load "root" states. When loading the "Cars & Bikes Insurance" and "Life Insurance" MFs, the store graph would be, at best:
Describe the solution you'd like
When registering a lazy-loaded state, to be able to provide a parent state, in order to become its sub state.
Option 1
Option 2
Beta Was this translation helpful? Give feedback.
All reactions