state-registry
v0.0.3
Published
Immutable application state registry
Downloads
5
Readme
state-registry
Immutable application state registry
API
const appState = new StateRegistry(initialState)
Add a change to the list of pending changes. See https://github.com/kolodny/immutability-helper for details.
appState.update(changeSet);
Perform all pending changes.
appState.commitChanges();
Add some changes and commit right away. This is the same as calling update() then commitChanges().
appState.updateAndCommit(changeSet);
Listen for state changes. The listener receive the new state as first argument and the old state as second argument.
appState.addChangeListener(listener);
Remove a change listener.
appState.removeChangeListener(listener);
Extend the update functionalities. See https://github.com/kolodny/immutability-helper for details.
appState.extendUpdate(directive, fnc);