How to use the redux-devtools-core/lib/utils.generateId function in redux-devtools-core

To help you get started, we’ve selected a few redux-devtools-core 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 jhen0409 / react-native-debugger / app / worker / remotedev.js View on Github external
export function connect(options = {}) {
  const id = generateId(options.instanceId);
  const opts = {
    ...options,
    instanceId: id,
    name: options.name || id,
    actionCreators: JSON.stringify(getActionsArray(options.actionCreators || {})),
  };
  start();
  return {
    init(state, action) {
      send(action || {}, state, 'INIT', opts);
    },
    subscribe(listener) {
      if (!listener) return undefined;
      if (!listeners[id]) listeners[id] = [];
      listeners[id].push(listener);
github jhen0409 / react-native-debugger / app / worker / reduxAPI.js View on Github external
shouldHotReload,
    shouldRecordChanges,
    shouldStartLocked,
    pauseActionType = '@@PAUSED',
    actionCreators,
    filters,
    actionsBlacklist,
    actionsWhitelist,
    actionSanitizer,
    stateSanitizer,
    deserializeState,
    deserializeAction,
    serialize,
    predicate,
  } = options;
  const id = generateId(options.instanceId);

  const serializeState = getSeralizeParameter(options, 'serializeState');
  const serializeAction = getSeralizeParameter(options, 'serializeAction');

  return next => (reducer, initialState) => {
    const store = configureStore(next, monitorReducer, {
      maxAge,
      shouldCatchErrors,
      shouldHotReload,
      shouldRecordChanges,
      shouldStartLocked,
      pauseActionType,
    })(reducer, initialState);

    instances[id] = {
      name: name || id,
github jhen0409 / react-native-debugger / app / worker / reduxAPI.js View on Github external
const compose = options => (...funcs) => (...args) => {
  const instanceId = generateId(options.instanceId);
  return [preEnhancer(instanceId), ...funcs].reduceRight(
    (composed, f) => f(composed),
    devToolsEnhancer({ ...options, instanceId })(...args)
  );
};