2019-05-30 07:33:38 +00:00
|
|
|
import { createStore, applyMiddleware } from 'redux';
|
|
|
|
import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction';
|
2019-08-15 07:48:16 +00:00
|
|
|
import rootReducer from './rootReducer';
|
2019-05-30 07:33:38 +00:00
|
|
|
import thunk from 'redux-thunk';
|
|
|
|
|
|
|
|
/* eslint-disable no-underscore-dangle */
|
|
|
|
const composeEnhancers = composeWithDevTools({
|
|
|
|
// options like actionSanitizer, stateSanitizer
|
|
|
|
});
|
|
|
|
|
|
|
|
const configureStore = prelodedState => (
|
|
|
|
createStore(
|
|
|
|
rootReducer,
|
|
|
|
prelodedState,
|
|
|
|
composeEnhancers(
|
|
|
|
applyMiddleware(thunk)
|
|
|
|
)
|
|
|
|
)
|
|
|
|
);
|
|
|
|
/* eslint-enable */
|
|
|
|
|
|
|
|
const store = configureStore({});
|
|
|
|
|
|
|
|
export default store;
|