2016-09-21 14:11:42 -08:00
|
|
|
import {createStore, applyMiddleware, compose} from 'redux';
|
|
|
|
|
import thunk from 'redux-thunk';
|
|
|
|
|
import rootReducer from '../reducers/index';
|
|
|
|
|
import effects from '../utils/effects';
|
|
|
|
|
import * as plugins from '../utils/plugins';
|
2017-09-25 03:55:04 -08:00
|
|
|
import writeMiddleware from './write-middleware';
|
2016-09-21 14:11:42 -08:00
|
|
|
|
|
|
|
|
export default () => {
|
|
|
|
|
const enhancer = compose(
|
2017-09-25 04:44:43 -08:00
|
|
|
applyMiddleware(thunk, plugins.middleware, thunk, writeMiddleware, effects),
|
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
|
|
|
};
|