2016-03-14 22:22:24 +00:00
|
|
|
import { createStore, applyMiddleware, compose } from 'redux';
|
|
|
|
import thunk from 'redux-thunk';
|
|
|
|
import { routerMiddleware } from 'react-router-redux';
|
|
|
|
import reducer from '../reducers';
|
|
|
|
import createSocketMiddleware from '../middleware/socket';
|
|
|
|
import commands from '../commands';
|
|
|
|
|
2017-04-30 00:21:36 +00:00
|
|
|
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(
|
2016-03-14 22:22:24 +00:00
|
|
|
applyMiddleware(
|
|
|
|
routerMiddleware(history),
|
|
|
|
thunk,
|
|
|
|
createSocketMiddleware(socket),
|
|
|
|
commands
|
2017-04-30 00:21:36 +00:00
|
|
|
)
|
|
|
|
));
|
2015-12-28 23:34:32 +00:00
|
|
|
}
|