text: import { applyMiddleware, createStore, compose } from 'redux';
  import thunk from 'redux-thunk';
  import rootReducer from '../reducers';
  import storage from '../utils/storage';
  
  // If Redux DevTools Extension is installed use it, otherwise use Redux compose
  /* eslint-disable no-underscore-dangle */
  const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ?
    window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({
    }) :
    compose;
  /* eslint-enable no-underscore-dangle */
  
  const enhancer = composeEnhancers(
    applyMiddleware(thunk),
    storage(),
  );
  
  export default function (initialState) {
    const store = createStore(rootReducer, initialState, enhancer);
  
    if (module.hot) {
      module.hot.accept('../reducers', () => {
        const nextRootReducer = require('../reducers');
  
        store.replaceReducer(nextRootReducer);
      });
    }
    return store;
  }
  