import { createStore , applyMiddleware , compose } from 'redux' ; import Logger from './Middleware/Logger' ; import rootReducer from './Reducers/root' ; declare const module ; interface IHotModule { hot ? : { accept : ( path : string , callback : ( ) => void ) => void ; } ; } ; const middleware = [ ] ; const enhancer = compose ( applyMiddleware ( ... middleware ) ) ; export default function configureStore ( initialState ) { const store = createStore ( rootReducer , initialState , enhancer ) ; if ( module . hot ) { module . hot . accept ( './Reducers/root' , ( ) => { const nextRootReducer = require ( './Reducers/root' ) . default ; store . replaceReducer ( nextRootReducer ) ; } ) ; } return store ; }