Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { createStore, applyMiddleware } from 'redux';
- import reducers from './reducers/index';
- import { persistReducer, persistStore } from 'redux-persist';
- import storage from 'redux-persist/lib/storage';
- import thunk from 'redux-thunk';
- const persistConfig = {
- key: 'root',
- storage
- };
- const persistedReducer = persistReducer( persistConfig, reducers );
- const store = createStore(
- persistedReducer,
- applyMiddleware( thunk )
- );
- const persistor = persistStore( store );
- export default { store, persistor };
Add Comment
Please, Sign In to add comment