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 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);
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user