Skip to content

Instantly share code, notes, and snippets.

@jonra1993
Last active March 14, 2021 19:39
Show Gist options
  • Save jonra1993/219fd7fb853f05507f4ec79bc5cdb370 to your computer and use it in GitHub Desktop.
Save jonra1993/219fd7fb853f05507f4ec79bc5cdb370 to your computer and use it in GitHub Desktop.
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