2016-08-31 23:15:12 +09:00
|
|
|
import { createStore, applyMiddleware, compose } from 'redux';
|
2017-01-09 20:37:15 +09:00
|
|
|
import thunk from 'redux-thunk';
|
|
|
|
import appReducer from '../reducers';
|
2017-01-16 21:27:58 +09:00
|
|
|
import loadingBarMiddleware from '../middleware/loading_bar';
|
2017-01-09 20:37:15 +09:00
|
|
|
import errorsMiddleware from '../middleware/errors';
|
2017-03-14 01:12:30 +09:00
|
|
|
import soundsMiddleware from '../middleware/sounds';
|
2016-08-25 00:56:44 +09:00
|
|
|
|
2017-01-09 20:37:15 +09:00
|
|
|
export default function configureStore() {
|
2017-01-18 04:09:03 +09:00
|
|
|
return createStore(appReducer, compose(applyMiddleware(
|
|
|
|
thunk,
|
|
|
|
loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
|
|
|
|
errorsMiddleware(),
|
2017-03-14 01:12:30 +09:00
|
|
|
soundsMiddleware()
|
2019-01-03 00:07:33 +09:00
|
|
|
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
|
2016-09-20 06:25:59 +09:00
|
|
|
};
|