redux-persist-kv-storage-polyfill
v0.0.2
Published
Redux Persist adapter for kv storage
Downloads
3
Readme
redux-persist-kv-storage-polyfill
Storage adapter to use kv-storage for redux-persist.
Installation
npm install --save redux-persist-kv-storage-polyfill
or
yarn add redux-persist-kv-storage-polyfill
How to use
For detail, please see example.
import { createStore } from "redux";
import { persistStore, persistReducer } from "redux-persist";
import createWebStorage from "redux-persist-kv-storage-polyfill";
const storage = createWebStorage();
const persistConfig = {
key: "root",
storage,
};
const persistedReducer = persistReducer(persistConfig, reducer);
export const configureStore = () => {
const store = createStore(persistedReducer);
return {
store,
persistor: persistStore(store),
};
};