frontend/src/store/configureStore.js

25 lines
510 B
JavaScript
Raw Normal View History

import { createStore, applyMiddleware, compose } from 'redux';
import thunk from 'redux-thunk';
import history from '../history';
import { routerMiddleware } from 'connected-react-router'
import rootReducer from '../reducers';
import getInitialState from '../utils/get-initial-state';
const initialState = getInitialState();
const store = createStore(
2018-12-08 18:27:19 +02:00
rootReducer(history),
initialState,
compose(
2018-12-08 18:27:19 +02:00
applyMiddleware(
routerMiddleware(history),
thunk
)
)
);
export default store;