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(
  rootReducer(history),
  initialState,
  compose(
    applyMiddleware(
      routerMiddleware(history),
      thunk
    )
  )
);

export default store;



