Use redux devtools extension compose and redux 3.1 style createStore

This commit is contained in:
Ken-Håvard Lieng 2017-04-30 02:21:36 +02:00
parent 294114028a
commit ab0bdc4401

View File

@ -5,16 +5,16 @@ import reducer from '../reducers';
import createSocketMiddleware from '../middleware/socket';
import commands from '../commands';
export default function configureStore(socket, history, initialState) {
const finalCreateStore = compose(
export default function configureStore(socket, history) {
// eslint-disable-next-line no-underscore-dangle
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
return createStore(reducer, composeEnhancers(
applyMiddleware(
routerMiddleware(history),
thunk,
createSocketMiddleware(socket),
commands
),
window.devToolsExtension ? window.devToolsExtension() : f => f
)(createStore);
return finalCreateStore(reducer, initialState);
)
));
}