summaryrefslogtreecommitdiff
path: root/frontend/src
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2017-01-20 20:36:50 +0100
committerVictor Chabbert <chabbertvi@eisti.eu>2017-01-20 23:25:26 +0100
commita20e046f7b866fe23a6cb6547653ab97107deac9 (patch)
treea609a990119a25602bf8a987017888074f53bb19 /frontend/src
parentUpdate deps, Add redux-saga-router (diff)
downloadseven-wonders-a20e046f7b866fe23a6cb6547653ab97107deac9.tar.gz
seven-wonders-a20e046f7b866fe23a6cb6547653ab97107deac9.tar.bz2
seven-wonders-a20e046f7b866fe23a6cb6547653ab97107deac9.zip
Fix duplicated calls of sagas based on history
Diffstat (limited to 'frontend/src')
-rw-r--r--frontend/src/store.js11
1 files changed, 4 insertions, 7 deletions
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)
}
}
bgstack15