summaryrefslogtreecommitdiff
path: root/frontend/src/store.js
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/store.js')
-rw-r--r--frontend/src/store.js43
1 files changed, 19 insertions, 24 deletions
diff --git a/frontend/src/store.js b/frontend/src/store.js
index bd05e2c5..ef9038eb 100644
--- a/frontend/src/store.js
+++ b/frontend/src/store.js
@@ -1,43 +1,38 @@
-import { createStore, applyMiddleware, compose } from 'redux'
-import { browserHistory } from 'react-router'
-import { syncHistoryWithStore, routerMiddleware } from 'react-router-redux'
-import Immutable from 'seamless-immutable'
+import { createStore, applyMiddleware, compose } from "redux";
+import { browserHistory } from "react-router";
+import { syncHistoryWithStore, routerMiddleware } from "react-router-redux";
+import Immutable from "seamless-immutable";
-import createReducer from './reducers'
-import createSagaMiddleware from 'redux-saga'
-import rootSaga from './sagas'
-import { makeSelectLocationState } from './redux/app'
+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()
+ const sagaMiddleware = createSagaMiddleware();
- const middlewares = [
- sagaMiddleware,
- routerMiddleware(browserHistory)
- ]
+ const middlewares = [sagaMiddleware, routerMiddleware(browserHistory)];
- const enhancers = [
- applyMiddleware(...middlewares)
- ]
+ const enhancers = [applyMiddleware(...middlewares)];
- const composeEnhancers =
- process.env.NODE_ENV !== 'production' &&
- typeof window === 'object' &&
- window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
- window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : compose;
+ const composeEnhancers = process.env.NODE_ENV !== "production" &&
+ typeof window === "object" &&
+ window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
+ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
+ : compose;
const store = createStore(
createReducer(),
Immutable.from(initialState),
composeEnhancers(...enhancers)
- )
+ );
- sagaMiddleware.run(rootSaga, browserHistory)
+ sagaMiddleware.run(rootSaga, browserHistory);
return {
store,
history: syncHistoryWithStore(browserHistory, store, {
selectLocationState: makeSelectLocationState()
})
- }
+ };
}
bgstack15