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