electron-store based engine for redux-storage.
npm install --save redux-storage-engine-electron-store
Simply invoke the function exported from this module to persist the Redux state store in the default store created by redux-storage.
import createEngine from 'redux-storage-engine-electron-store';
const engine = createEngine();
The function accepts an optional options
argument with the following keys:
-
store
: a custom redux-storage store to use instead of the default one, or an object that is passed directly to the constructor ofStore
in redux-storage in order to construct a new store. -
key
: an optional key under which the state will be stored in the store object. Whenundefined
, the entire store will be used to store the Redux state.
For instance, to persist the Redux store into a file named state.json
under
the key named reduxStore
:
import createEngine from 'redux-storage-engine-electron-store';
const engine = createEngine({
key: 'reduxStore',
store: {
name: 'reduxStore'
}
});