ngxs / store

🚀 NGXS - State Management for Angular
http://ngxs.io
MIT License
3.54k stars 403 forks source link

How to organize ngxs store #1142

Closed kunjee17 closed 5 years ago

kunjee17 commented 5 years ago

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.

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.

poloagustin commented 5 years ago

You can ask questions in:

I prefer slack because responses are usually faster :)

arturovt commented 5 years ago

Closing this issue as I saw that you asked it on the SO and Slack :wink: