Guest User

Untitled

a guest
May 27th, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. import { createStore, applyMiddleware } from 'redux';
  2. import reducers from './reducers/index';
  3. import { persistReducer, persistStore } from 'redux-persist';
  4. import storage from 'redux-persist/lib/storage';
  5. import thunk from 'redux-thunk';
  6.  
  7. const persistConfig = {
  8. key: 'root',
  9. storage
  10. };
  11. const persistedReducer = persistReducer( persistConfig, reducers );
  12.  
  13. const store = createStore(
  14. persistedReducer,
  15. applyMiddleware( thunk )
  16. );
  17.  
  18. const persistor = persistStore( store );
  19.  
  20. export default { store, persistor };
Add Comment
Please, Sign In to add comment