import { applyMiddleware, compose, createStore, Store } from 'redux'; import { routerMiddleware } from 'react-router-redux'; import { SagaMiddleware } from 'redux-saga'; import { History } from 'history'; import { reducer, State } from './configureRedux'; export default function configureStore(history: History, sagaMiddleware: SagaMiddleware): Store { const middlewares = [sagaMiddleware, routerMiddleware(history)]; const store = createStore( reducer, applyMiddleware(...middlewares), ); // sagaMiddleware.run(rootSaga); return store; }