text: import { createStore, applyMiddleware, compose } from 'redux'
  import createLogger from 'redux-logger'
  import rootReducer from '../reducers'
  import createSagaMiddleware, { END } from 'redux-saga'
  import DevTools from '../containers/DevTools'
  import trail from '../middleware/trail'
  
  export default function configureStore(initialState) {
    const sagaMiddleware = createSagaMiddleware()
    const store = createStore(
      rootReducer,
      initialState,
      compose(
        applyMiddleware(sagaMiddleware, trail, createLogger({
          collapsed: () => true
        })),
        DevTools.instrument()
      )
    )
  
    if (module.hot) {
      module.hot.accept('../reducers', () => {
        const nextRootReducer = require('../reducers').default
        store.replaceReducer(nextRootReducer)
      })
    }
  
    store.runSaga = sagaMiddleware.run
    store.close = () => store.dispatch(END)
    return store
  }
  