import { createStore , applyMiddleware , compose , combineReducers } from 'redux' ; import thunk from 'redux-thunk' ; import rootReducer from './reducers' ; import { createLogger } from 'redux-logger' ; import config from '@config/feature.config' ; let middleware = [ thunk ] ; if ( config . reduxLog ) middleware . push ( createLogger ( ) ) ; export default function configureStore ( initialState = { } ) { const store = createStore ( combineReducers ( rootReducer ) , initialState , compose ( applyMiddleware ( ... middleware ) ) ) ; return store ; }