Managing state in an application can sometime become a complex problem, especially when there is a requirement to perform an action when data changes overtime. An action can be as simple as updating a UI component when it happens.
- centrally managing the state
- get notified whenever data changes
- no memory leaks and performance problems
- manage state over different channels (memory, sessionStorage, localStorage)
DataStore library does that all. Right now only MemoryStore is supported, however this should fulfill all the needs of a webapp today. The readme for the library is self explanatory, so I will not post it here.
It currently has a full blown example use case in angular that you would like to check out.
Initially when i developed it a year back, i was required to replicate it in all my projects by copying the source all over. Few days back i just thought of creating an npm package and make it available to community as well. This is where we all can collaborate and share ideas about improving it.
In case if you have any questions, pls do reach out to me.