import { Store , applyMiddleware , compose , createStore } from 'redux' ; import { CompactdState } from 'definitions' ; import { reducers } from './reducers' ; import createHistory from 'history/createBrowserHistory' ; import * as reduxPromise from 'redux-promise' ; import reduxThunk from 'redux-thunk' ; import { routerMiddleware } from 'react-router-redux' ; import { withRouter } from 'react-router-dom' ; export const history = createHistory ( ) ; const middleware = routerMiddleware ( history ) ; export class CompactdStore { compose : typeof compose ; constructor ( ) { this . compose = ( window as any ) . __REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose ; } configureStore ( ) { const enhancer = this . compose ( applyMiddleware ( middleware , reduxThunk , reduxPromise ) ) ( createStore ) ; return enhancer ( reducers ) ; } }