import { applyMiddleware , Store } from 'redux' ; import { createStore } from 'redux' ; import thunkMiddleware from "redux-thunk" ; import { routerMiddleware } from 'react-router-redux' ; import { History } from 'history' ; import rootReduce from "../reducer/reducer" ; function configureStore ( history , initalState ? ) { const middleware = applyMiddleware ( thunkMiddleware , routerMiddleware ( history ) ) ; return createStore ( rootReduce , middleware ) as Store ; } export default configureStore ;