Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

redux-persist

// configureStore.js import { createStore } from 'redux'import { persistStore, persistReducer } from 'redux-persist'import storage from 'redux-persist/lib/storage' // defaults to localStorage for web import rootReducer from './reducers' const persistConfig = {  key: 'root',  storage,} const persistedReducer = persistReducer(persistConfig, rootReducer) export default () => {  let store = createStore(persistedReducer)  let persistor = persistStore(store)  return { store, persistor }}
Source by www.npmjs.com #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
1+8 =