text: //This file merely configures the store for hot reloading.
  //This boilerplate file is likely to be the same for each project that uses Redux.
  //With Redux, the actual stores are in /reducers.
  
  import {createStore, applyMiddleware, compose} from 'redux';
  import thunk from 'redux-thunk';
  import createLogger from 'redux-logger';
  import api from '../middleware/api';
  import ApiClient from '../helpers/AuthApiClient';
  import rootReducer from '../reducers';
  import apiErrors from '../middleware/apiErrors';
  
  export default function configureStore(initialState) {
    const middlewares = [thunk, api(new ApiClient()), apiErrors, createLogger()];
  
    const store = createStore(rootReducer, initialState, compose(
      applyMiddleware(...middlewares),
      window.devToolsExtension ? window.devToolsExtension() : f => f
    ));
  
    if (module.hot) {
      // Enable Webpack hot module replacement for reducers
      module.hot.accept('../reducers', () => {
        const nextReducer = require('../reducers').default;
        store.replaceReducer(nextReducer);
      });
    }
  
    return store;
  }
  