summaryrefslogtreecommitdiff
path: root/frontend/src/store.js
diff options
context:
space:
mode:
authorVictor Chabbert <chabbertvi@eisti.eu>2017-07-25 00:09:31 +0200
committerVictor Chabbert <chabbertvi@eisti.eu>2017-08-07 22:41:20 +0200
commit3b1e1a77dbf93f5312f90b6545a1f34b5b609792 (patch)
treeff479637adcf67ac75894f81189bb2604f6e17ab /frontend/src/store.js
parentRemove redux-saga-router (diff)
downloadseven-wonders-3b1e1a77dbf93f5312f90b6545a1f34b5b609792.tar.gz
seven-wonders-3b1e1a77dbf93f5312f90b6545a1f34b5b609792.tar.bz2
seven-wonders-3b1e1a77dbf93f5312f90b6545a1f34b5b609792.zip
Updrade react router and react router redux
Diffstat (limited to 'frontend/src/store.js')
-rw-r--r--frontend/src/store.js17
1 files changed, 8 insertions, 9 deletions
diff --git a/frontend/src/store.js b/frontend/src/store.js
index 47b2073e..37bc0822 100644
--- a/frontend/src/store.js
+++ b/frontend/src/store.js
@@ -1,17 +1,18 @@
// @flow
+import { createStore, applyMiddleware, compose } from 'redux';
+import createHistory from 'history/createBrowserHistory';
+import { routerMiddleware } from 'react-router-redux';
import { fromJS } from 'immutable';
-import { browserHistory } from 'react-router';
-import { routerMiddleware, syncHistoryWithStore } from 'react-router-redux';
-import { applyMiddleware, compose, createStore } from 'redux';
import createSagaMiddleware from 'redux-saga';
import createReducer from './reducers';
-import { makeSelectLocationState } from './redux/app';
import rootSaga from './sagas';
export default function configureStore(initialState: Object = {}) {
const sagaMiddleware = createSagaMiddleware();
- const middlewares = [sagaMiddleware, routerMiddleware(browserHistory)];
+ const history = createHistory();
+
+ const middlewares = [sagaMiddleware, routerMiddleware(history)];
const enhancers = [applyMiddleware(...middlewares)];
@@ -23,12 +24,10 @@ export default function configureStore(initialState: Object = {}) {
const store = createStore(createReducer(), fromJS(initialState), composeEnhancers(...enhancers));
- sagaMiddleware.run(rootSaga, browserHistory);
+ sagaMiddleware.run(rootSaga, history);
return {
store,
- history: syncHistoryWithStore(browserHistory, store, {
- selectLocationState: makeSelectLocationState(),
- }),
+ history,
};
}
bgstack15