receptor/src/store.js

20 lines
373 B
JavaScript
Raw Normal View History

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