This is more of an question. So, please don't mind closing it if it is not at right place. Also provide direction where to ask if not here.
I am coming from Elm / Elmish background. And to be fair, I tried to learn NgRx first. There were too much of boiler plate but I did take is as only option available. Then I found out about ngxs. And it is good. Too good.
Here is a question. I couldn't found documentation to arrange multiple store. For any big application, keeping all data in memory is not an option.
In Elm / Elmish application, model (here store) only has data which is required by whole application like JWT Token, and other page data are union type. So, it would be loaded as and when page requires it. It will be replaced by another page data when page changes.
NGRX is doing some lazy module loading to address this issue. There is some documentation on sub store. But I don't get it when to use it.
Here is my (partial) understanding.
use separate store par page. As in most cases those components needs to communicate with each other.
Need one kind of global / app store which is having all the details required by whole application. (Now this part I can't get it. Means where to put it and is other will be part of this store)
Sub store when communicating with complex components or pages (Pages might not required as I normally like URL to init all events )
I just couldn't wire all things up, to match requirement that stale data should not be there in store. Or even stale store should not be there in memory.
Please let me know if something is not clear or missing.
This is more of an question. So, please don't mind closing it if it is not at right place. Also provide direction where to ask if not here.
I am coming from Elm / Elmish background. And to be fair, I tried to learn NgRx first. There were too much of boiler plate but I did take is as only option available. Then I found out about ngxs. And it is good. Too good.
Here is a question. I couldn't found documentation to arrange multiple store. For any big application, keeping all data in memory is not an option.
In Elm / Elmish application, model (here store) only has data which is required by whole application like
JWT Token
, and other page data are union type. So, it would be loaded as and when page requires it. It will be replaced by another page data when page changes.NGRX is doing some lazy module loading to address this issue. There is some documentation on sub store. But I don't get it when to use it.
Here is my (partial) understanding.
global / app
store which is having all the details required by whole application. (Now this part I can't get it. Means where to put it and is other will be part of this store)init
all events )I just couldn't wire all things up, to match requirement that
stale
data should not be there in store. Or evenstale
store should not be there in memory.Please let me know if something is not clear or missing.