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