redux-cube-with-persist
v1.1.2
Published
redux-cube's pluggable module for react-persist
Downloads
32
Maintainers
Readme
redux-cube-with-persist
redux-cube's pluggable module for redux-persist
npm install --save redux-cube-with-persist
NOTE: redux-cube-with-persist cannot be used with redux-cube-with-immutable
Get Started
// xxx/App.jsx
import { createApp } from 'redux-cube';
import withPersist from 'redux-cube-with-persist';
import localforage from 'localforage';
import withRouter from 'redux-cube-with-router';
@createApp(withPersist(withRouter({
reducers: {
// ...
},
// optional
// https://github.com/rt2zz/redux-persist#storage-engines
persistStorage: localforage,
// optional
// https://github.com/rt2zz/redux-persist/blob/master/docs/api.md#type-persistconfig
persistKey = 'persistRoot',
// optional
// https://github.com/rt2zz/redux-persist/blob/master/docs/api.md#type-persistconfig
persistConfig: {
// ...
},
// optional
// https://github.com/rt2zz/redux-persist-transform-immutable#usage-with-records
persistImmutableConfig: {
// ...
},
// ...
}))))
class SubApp extends PureComponent {
render() {
// ...
}
}