blob: 0b569339da51ee1a5f7380a4f1dd1b4d65a10a6a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
import { applyMiddleware, compose, createStore } from 'redux';
import { persistReducer, persistStore } from 'redux-persist';
import thunk from 'redux-thunk';
import storage from 'redux-persist/lib/storage';
import autoMergeLevel2 from 'redux-persist/lib/stateReconciler/autoMergeLevel2';
import rootReducer from './redux/reducers';
const persistedReducers = persistReducer(
{
key: 'githunt:root',
storage: storage,
stateReconciler: autoMergeLevel2,
},
rootReducer,
);
export const store = createStore(
persistedReducers,
compose(
applyMiddleware(thunk),
window.devToolsExtension ? window.devToolsExtension() : f => f
)
);
export const persist = persistStore(store);
|