From a20e046f7b866fe23a6cb6547653ab97107deac9 Mon Sep 17 00:00:00 2001 From: Victor Chabbert Date: Fri, 20 Jan 2017 20:36:50 +0100 Subject: Fix duplicated calls of sagas based on history --- frontend/src/store.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'frontend') diff --git a/frontend/src/store.js b/frontend/src/store.js index 750c9c72..e028bac1 100644 --- a/frontend/src/store.js +++ b/frontend/src/store.js @@ -1,5 +1,5 @@ import { createStore, applyMiddleware, compose } from 'redux' -import { browserHistory} from 'react-router' +import { browserHistory } from 'react-router' import { syncHistoryWithStore, routerMiddleware } from 'react-router-redux' import createReducer from './reducers' @@ -8,11 +8,10 @@ import rootSaga from './sagas' export default function configureStore(initialState = {}) { const sagaMiddleware = createSagaMiddleware() - const history = browserHistory const middlewares = [ sagaMiddleware, - routerMiddleware(history) + routerMiddleware(browserHistory) ] const enhancers = [ @@ -31,12 +30,10 @@ export default function configureStore(initialState = {}) { composeEnhancers(...enhancers) ) - const syncedHistory = syncHistoryWithStore(history, store) - - sagaMiddleware.run(rootSaga, syncedHistory) + sagaMiddleware.run(rootSaga, browserHistory) return { store, - history: syncedHistory + history: syncHistoryWithStore(browserHistory, store) } } -- cgit