import { createStore , applyMiddleware } from 'redux' ; import { createHashHistory } from 'history' ; import thunk from 'redux-thunk' ; import createRootReducer from '../reducers' ; import { Store } from '../reducers/types' ; import api from '../middleware/api' ; import handler from '../middleware/handler' ; const history = createHashHistory ( ) ; const rootReducer = createRootReducer ( history ) ; const enhancer = applyMiddleware ( thunk , api , handler ) ; function configureStore ( initialState ) { return createStore ( rootReducer , initialState , enhancer ) ; } export default { configureStore , history } ;