How to use the redux-devtools-extension/developmentOnly.devToolsEnhancer function in redux-devtools-extension

To help you get started, we’ve selected a few redux-devtools-extension 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 0xProject / 0x-monorepo / packages / website / ts / redux / store.ts View on Github external
import * as _ from 'lodash';
import { createStore, Store as ReduxStore } from 'redux';
import { devToolsEnhancer } from 'redux-devtools-extension/developmentOnly';
import { stateStorage } from 'ts/local_storage/state_storage';
import { reducer, State } from 'ts/redux/reducer';

const ONE_SECOND = 1000;

export const store: ReduxStore = createStore(
    reducer,
    stateStorage.getPersistedDefaultState(),
    devToolsEnhancer({ name: '0x Website Redux Store' }),
);
store.subscribe(
    _.throttle(() => {
        // Persisted state
        stateStorage.saveState({
            hasPortalOnboardingBeenClosed: store.getState().hasPortalOnboardingBeenClosed,
        });
    }, ONE_SECOND),
);
github ThymeApp / thyme / src / register / Store.js View on Github external
return {
          ...state,
          hiddenColumns: {
            ...state.hiddenColumns,
            [name]: filters.indexOf(column) > -1
              ? filters.filter((item) => item !== column)
              : [...filters, column],
          },
        };
      }
      default:
        return state;
    }
  },
  defaultState,
  devToolsEnhancer(),
);
github 0xProject / 0x-monorepo / packages / instant / src / redux / store.ts View on Github external
create: (initialState: State): Store => {
        const reducer = createReducer(initialState);
        return createStore(reducer, initialState, devToolsEnhancer({}));
    },
};