14 lines
441 B
TypeScript
14 lines
441 B
TypeScript
import { createStore } from 'redux';
|
|
import { persistStore, persistReducer, PersistConfig } from 'redux-persist';
|
|
import storage from 'redux-persist/lib/storage';
|
|
import { reducers } from './reducers';
|
|
|
|
const persistConfig: PersistConfig = {
|
|
key: 'root',
|
|
storage,
|
|
};
|
|
|
|
const persistedReducer = persistReducer(persistConfig, reducers);
|
|
|
|
export const store = createStore(persistedReducer);
|
|
export const persistor = persistStore(store);
|