Last active
March 14, 2021 19:39
-
-
Save jonra1993/219fd7fb853f05507f4ec79bc5cdb370 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { configureStore } from '@reduxjs/toolkit'; | |
import storage from 'redux-persist/lib/storage' | |
import { persistStore, persistReducer } from 'redux-persist'; | |
import thunk from 'redux-thunk' | |
import rootReducer from './rootReducer'; | |
const ENABLE_REDUX_DEV_TOOLS = true; | |
const persistConfig = { | |
key: 'root', | |
storage: storage, | |
timeout: null, | |
}; | |
const persistedReducer = persistReducer(persistConfig, rootReducer); | |
export const store = configureStore({ | |
reducer: persistedReducer, | |
devTools: ENABLE_REDUX_DEV_TOOLS, | |
middleware: [thunk] | |
}); | |
export const persistor = persistStore(store); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment