text: import { createStore, applyMiddleware, compose } from 'redux'
  import thunk from 'redux-thunk'
  import reducer from '../reducers'
  
  const createStoreWithMiddleware = compose(
      applyMiddleware(thunk),
      window.devToolsExtension ? window.devToolsExtension() : f => f
    )(createStore);
  
  export default function configureStore(initialState) {
    const store = createStoreWithMiddleware(reducer, initialState)
  
    if (module.hot) {
      // Enable Webpack hot module replacement for reducers
      module.hot.accept('../reducers', () => {
        const nextReducer = require('../reducers')
        store.replaceReducer(nextReducer)
      })
    }
  
    return store
  }
  