text: /**
   * Main store function
   */
  import "regenerator-runtime/runtime";
  import { createStore, applyMiddleware, compose } from 'redux';
  import thunk from 'redux-thunk';
  import DevTools from './modules/App/components/DevTools';
  import rootReducer from './reducers';
  import createSagaMiddleware from "redux-saga";
  import rootSaga from "./sagas";
  
  export function configureStore(initialState = {}) {
    const sagaMiddleware = createSagaMiddleware();
    // const reduxDevTools = window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__();
    // Middleware and store enhancers
    const enhancers = [
      applyMiddleware(sagaMiddleware),
      // reduxDevTools
    ];
  
    if (process.env.CLIENT && process.env.NODE_ENV === 'development') {
      // Enable DevTools only when rendering on client and during development.
      enhancers.push(window.devToolsExtension ? window.devToolsExtension() : DevTools.instrument());
    }
  
    const store = createStore(rootReducer, initialState, compose(...enhancers));
  
    sagaMiddleware.run(rootSaga);
  
    // For hot reloading reducers
    if (module.hot) {
      // Enable Webpack hot module replacement for reducers
      module.hot.accept('./reducers', () => {
        const nextReducer = require('./reducers').default; // eslint-disable-line global-require
        store.replaceReducer(nextReducer);
      });
    }
  
    return store;
  }
  