redux-zero-persist
v0.2.6
Published
redux-zero persist middleware
Downloads
37
Readme
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
| Axetroy💻 🐛 🎨 | | :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |