2017-08-22 00:10:52 +02:00
|
|
|
import {
|
|
|
|
applyMiddleware,
|
|
|
|
createStore,
|
|
|
|
compose
|
|
|
|
} from 'redux';
|
|
|
|
import thunk from 'redux-thunk';
|
2017-08-20 17:57:57 +02:00
|
|
|
import reducer from './reducers';
|
|
|
|
|
2017-08-22 00:10:52 +02:00
|
|
|
const _compose =
|
|
|
|
window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__
|
|
|
|
|| compose;
|
2017-08-20 17:57:57 +02:00
|
|
|
const store = createStore(
|
|
|
|
reducer,
|
2017-08-22 00:10:52 +02:00
|
|
|
_compose(applyMiddleware(thunk)),
|
2017-08-20 17:57:57 +02:00
|
|
|
);
|
|
|
|
|
2017-08-22 00:10:52 +02:00
|
|
|
export const dispatch = action => store.dispatch(action);
|
|
|
|
|
2017-08-20 17:57:57 +02:00
|
|
|
export default store;
|