text: import { applyMiddleware, createStore, compose } from 'redux';
  import { createLogger } from 'redux-logger';
  import thunk from 'redux-thunk';
  import { routerMiddleware } from 'react-router-redux';
  import { browserHistory } from 'react-router';
  
  import rootReducer from '../reducers';
  
  const configureStore = preloadedState => {
    const store = createStore(
      rootReducer,
      preloadedState,
      compose(
        applyMiddleware(thunk, routerMiddleware(browserHistory), createLogger())
      )
    );
  
    if (module.hot) {
      module.hot.accept('../reducers', () => {
        const nextRootReducer = require('../reducers').default;
        store.replaceReducer(nextRootReducer);
      });
    }
  
    return store;
  };
  
  export default configureStore;
  