Use redux devtools extension compose and redux 3.1 style createStore
This commit is contained in:
parent
294114028a
commit
ab0bdc4401
@ -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);
|
||||
)
|
||||
));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user