How to use the redux-devtools.default function in redux-devtools

To help you get started, we’ve selected a few redux-devtools examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github FallOutChonny / react-starter-boilerplate / src / configureStore.js View on Github external
function configureStore(history, initialState = {}) {
  const sagaMiddleware = createSagaMiddleware();
  const reduxRouterMiddleware = routerMiddleware(history);
  const middlewares = [sagaMiddleware, reduxRouterMiddleware];
  const enhancers = [];

  if (__CLIENT__ && __DEV__ && !window.__REDUX_DEVTOOLS_EXTENSION__) {
    const { persistState } = require('redux-devtools').default;
    const DevTools = require('./client/createDevTools').default;
    enhancers.push(DevTools.instrument());
    enhancers.push(
      persistState(window.location.href.match(/[?&]debug_session=([^&#]+)\b/))
    );
  }

  if (__CLIENT__ && window.__REDUX_DEVTOOLS_EXTENSION__) {
    enhancers.push(window.__REDUX_DEVTOOLS_EXTENSION__());
  }

  const store = createStore(
    createReducer(),
    initialState,
    compose(applyMiddleware(...middlewares), ...enhancers)
  );