text: import rootReducer          from '../reducers';
  import thunk                from 'redux-thunk';
  import DevTools             from 'containers/DevTools';
  import {
    applyMiddleware,
    compose,
    createStore
  } from 'redux';
  
  export default function configureStore (initialState, debug = false) {
    let createStoreWithMiddleware;
  
    const middleware = applyMiddleware(thunk);
  
    if (debug) {
      createStoreWithMiddleware = compose(
        middleware,
        DevTools.instrument()
      );
    } else {
      createStoreWithMiddleware = compose(middleware);
    }
  
    const store = createStoreWithMiddleware(createStore)(
      rootReducer, initialState
    );
     /* istanbul ignore if */
    if (module.hot) {
      module.hot.accept('../reducers', () => {
        const nextRootReducer = require('../reducers/index');
  
        store.replaceReducer(nextRootReducer);
      });
    }
    return store;
  }
  