diff options
Diffstat (limited to 'front/odiparpack/app/redux/configureStore.js')
| -rw-r--r-- | front/odiparpack/app/redux/configureStore.js | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/front/odiparpack/app/redux/configureStore.js b/front/odiparpack/app/redux/configureStore.js index 80c84c0..767af03 100644 --- a/front/odiparpack/app/redux/configureStore.js +++ b/front/odiparpack/app/redux/configureStore.js @@ -8,14 +8,15 @@ import { routerMiddleware } from 'connected-react-router/immutable'; import createSagaMiddleware from 'redux-saga'; import createReducer from './reducers'; import thunk from 'redux-thunk'; +import { composeWithDevTools } from "redux-devtools-extension"; const sagaMiddleware = createSagaMiddleware(); -export default function configureStore(initialState = {}, history) { +export function configureStore(initialState = {}, history) { // Create the store with two middlewares // 1. sagaMiddleware: Makes redux-sagas work // 2. routerMiddleware: Syncs the location/URL path to the state - const middlewares = [thunk,sagaMiddleware, routerMiddleware(history)]; + const middlewares = [thunk, routerMiddleware(history)]; const enhancers = [applyMiddleware(...middlewares)]; @@ -35,13 +36,13 @@ export default function configureStore(initialState = {}, history) { const store = createStore( createReducer(), fromJS(initialState), - composeEnhancers(...enhancers) + composeWithDevTools(applyMiddleware(thunk)) ); // Extensions - store.runSaga = sagaMiddleware.run; + //store.runSaga = sagaMiddleware.run; store.injectedReducers = {}; // Reducer registry - store.injectedSagas = {}; // Saga registry + //store.injectedSagas = {}; // Saga registry // Make reducers hot reloadable, see http://mxs.is/googmo /* istanbul ignore next */ @@ -53,3 +54,12 @@ export default function configureStore(initialState = {}, history) { return store; } + +export function confStore (){ + const store = createStore( + createReducer(), + composeWithDevTools(applyMiddleware(thunk)) + ); + store.injectedReducers = {}; + return store; +} |
