diff options
author | Victor Chabbert <chabbertvi@eisti.eu> | 2017-01-22 18:34:14 +0100 |
---|---|---|
committer | Victor Chabbert <chabbertvi@eisti.eu> | 2017-01-22 19:28:49 +0100 |
commit | 0c9e9480471848a4b8670da22b609535cb153ff3 (patch) | |
tree | e59256cb6e8ec6b1041db8ed9902f89e4c39d2e2 /frontend/src/store.js | |
parent | Add notification for updated game to /topics/games (diff) | |
download | seven-wonders-0c9e9480471848a4b8670da22b609535cb153ff3.tar.gz seven-wonders-0c9e9480471848a4b8670da22b609535cb153ff3.tar.bz2 seven-wonders-0c9e9480471848a4b8670da22b609535cb153ff3.zip |
Made redux store fully immutable
Diffstat (limited to 'frontend/src/store.js')
-rw-r--r-- | frontend/src/store.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/frontend/src/store.js b/frontend/src/store.js index e028bac1..2000d706 100644 --- a/frontend/src/store.js +++ b/frontend/src/store.js @@ -1,10 +1,12 @@ import { createStore, applyMiddleware, compose } from 'redux' import { browserHistory } from 'react-router' import { syncHistoryWithStore, routerMiddleware } from 'react-router-redux' +import { fromJS } from 'immutable' import createReducer from './reducers' import createSagaMiddleware from 'redux-saga' import rootSaga from './sagas' +import { makeSelectLocationState } from './redux/app' export default function configureStore(initialState = {}) { const sagaMiddleware = createSagaMiddleware() @@ -26,7 +28,7 @@ export default function configureStore(initialState = {}) { const store = createStore( createReducer(), - initialState, + fromJS(initialState), composeEnhancers(...enhancers) ) @@ -34,6 +36,8 @@ export default function configureStore(initialState = {}) { return { store, - history: syncHistoryWithStore(browserHistory, store) + history: syncHistoryWithStore(browserHistory, store, { + selectLocationState: makeSelectLocationState() + }) } } |