2016-09-21 14:11:42 -08:00
|
|
|
import {createStore, applyMiddleware, compose} from 'redux';
|
|
|
|
|
import thunk from 'redux-thunk';
|
2017-06-02 07:43:47 -08:00
|
|
|
import {createLogger} from 'redux-logger';
|
2016-09-21 14:11:42 -08:00
|
|
|
import rootReducer from '../reducers/index';
|
|
|
|
|
import effects from '../utils/effects';
|
|
|
|
|
import * as plugins from '../utils/plugins';
|
|
|
|
|
|
|
|
|
|
export default () => {
|
|
|
|
|
const logger = createLogger({
|
|
|
|
|
level: 'info',
|
|
|
|
|
collapsed: true
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const enhancer = compose(
|
2017-09-24 14:26:50 -08:00
|
|
|
applyMiddleware(thunk, plugins.middleware, thunk, effects, logger),
|
2016-09-21 14:11:42 -08:00
|
|
|
window.devToolsExtension()
|
|
|
|
|
);
|
|
|
|
|
|
2017-09-10 05:35:10 -08:00
|
|
|
return createStore(rootReducer, enhancer);
|
2016-09-21 14:11:42 -08:00
|
|
|
};
|