2016-08-31 10:15:12 -04:00
|
|
|
import { createStore, applyMiddleware, compose } from 'redux';
|
2016-09-19 17:25:59 -04:00
|
|
|
import thunk from 'redux-thunk';
|
|
|
|
import appReducer from '../reducers';
|
|
|
|
import { loadingBarMiddleware } from 'react-redux-loading-bar';
|
2016-10-18 11:09:45 -04:00
|
|
|
import errorsMiddleware from '../middleware/errors';
|
2016-08-24 11:56:44 -04:00
|
|
|
|
2016-08-31 10:15:12 -04:00
|
|
|
export default function configureStore(initialState) {
|
2016-09-19 17:25:59 -04:00
|
|
|
return createStore(appReducer, initialState, compose(applyMiddleware(thunk, loadingBarMiddleware({
|
|
|
|
promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'],
|
2016-10-18 11:09:45 -04:00
|
|
|
}), errorsMiddleware()), window.devToolsExtension ? window.devToolsExtension() : f => f));
|
2016-09-19 17:25:59 -04:00
|
|
|
};
|