redux-action-store
Save and load actions to persist state
Install for server-side use of redux
npm i redux-action-store
Simple usage
// store.js'use strict'; const redux = ;const app = ;const middleware = ;const ActionStore = ; // attempt to load actions from JSON file, otherwise create a blank oneconst actionStore = ActionStore;// add SIGINT and beforeExit hook to save back to JSON fileactionStore;/* You can also persist directly (sync) using: actionStore.toJson('./actions.json');*/ moduleexports = reduxactionStorecreateStore;
Notes
- If using the
setPersistence
hooks, please make sure to exit explicitly onCTRL-C
. - As you should probably expect, replaying won't flare any side-effects (middleware).