Awesome
redux-zero persist middleware
Usage
const createStore = require("redux-zero")
const applyMiddleware = require("redux-zero/middleware")
const persist = require("redux-zero-persist");
const persistMiddleware = persist({ key: "[key]", storage: require("localforage") }, function(
err,
state
) {
if (err) {
console.error(err);
} else {
store.setState(state);
}
});
const middlewares = applyMiddleware(
persistMiddleware,
antoherMiddleware
);
const store = createStore(initialState, middlewares);
Contributing
如果你觉得项目不错,不要吝啬你的 star.
长期造轮子,欢迎 follow.
Contributors
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --><img src="https://avatars1.githubusercontent.com/u/9758711?v=3" width="100px;"/><br /><sub>Axetroy</sub><br />💻 🐛 🎨 |
---|