import { applyMiddleware , compose , createStore } from 'redux' ; import createSagaMiddleware from 'redux-saga' ; import rootReducer from '../reducers/rootReducer' ; import rootSaga from '../sagas/rootSaga' ; const sagaMiddleware = createSagaMiddleware ( ) ; const composeEnhancers = ( window as any ) . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose ; export default function configureStore ( ) { const store = createStore ( rootReducer , composeEnhancers ( applyMiddleware ( sagaMiddleware ) ) ) ; sagaMiddleware . run ( rootSaga ) ; return store ; }