How to use the redux-devtools-core/lib/utils.stringify 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 / reduxAPI.js View on Github external
? state
        : stringify(
          filterState(
            state,
            type,
            filters,
            stateSanitizer,
            actionSanitizer,
            nextActionId,
            predicate
          ),
          serializeState
        );
  }
  if (type === 'ACTION') {
    message.action = stringify(
      !actionSanitizer ? action : actionSanitizer(action.action, nextActionId - 1),
      serializeAction
    );
    message.isExcess = isExcess;
    message.nextActionId = nextActionId;
  } else if (instance) {
    message.libConfig = {
      type: 'redux',
      actionCreators: stringify(instance.actionCreators),
      serialize: !!instance.serialize,
    };
  }
  postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: message });
}
github jhen0409 / react-native-debugger / app / worker / reduxAPI.js View on Github external
function exportState({ id: instanceId, store, serializeState }) {
  const liftedState = store.liftedStore.getState();
  const actionsById = liftedState.actionsById;
  const payload = [];
  liftedState.stagedActionIds.slice(1).forEach(id => {
    payload.push(actionsById[id].action);
  });
  postMessage({
    __IS_REDUX_NATIVE_MESSAGE__: true,
    content: {
      type: 'EXPORT',
      payload: stringify(payload, serializeState),
      committedState:
        typeof liftedState.committedState !== 'undefined'
          ? stringify(liftedState.committedState, serializeState)
          : undefined,
      instanceId,
    },
  });
}
github jhen0409 / react-native-debugger / app / worker / reduxAPI.js View on Github external
function exportState({ id: instanceId, store, serializeState }) {
  const liftedState = store.liftedStore.getState();
  const actionsById = liftedState.actionsById;
  const payload = [];
  liftedState.stagedActionIds.slice(1).forEach(id => {
    payload.push(actionsById[id].action);
  });
  postMessage({
    __IS_REDUX_NATIVE_MESSAGE__: true,
    content: {
      type: 'EXPORT',
      payload: stringify(payload, serializeState),
      committedState:
        typeof liftedState.committedState !== 'undefined'
          ? stringify(liftedState.committedState, serializeState)
          : undefined,
      instanceId,
    },
  });
}
github jhen0409 / react-native-debugger / app / worker / reduxAPI.js View on Github external
predicate
          ),
          serializeState
        );
  }
  if (type === 'ACTION') {
    message.action = stringify(
      !actionSanitizer ? action : actionSanitizer(action.action, nextActionId - 1),
      serializeAction
    );
    message.isExcess = isExcess;
    message.nextActionId = nextActionId;
  } else if (instance) {
    message.libConfig = {
      type: 'redux',
      actionCreators: stringify(instance.actionCreators),
      serialize: !!instance.serialize,
    };
  }
  postMessage({ __IS_REDUX_NATIVE_MESSAGE__: true, content: message });
}
github jhen0409 / react-native-debugger / app / worker / reduxAPI.js View on Github external
stateSanitizer,
    actionSanitizer,
    serializeState,
    serializeAction,
  } = instance;

  const message = {
    type,
    id: instance.id,
    name: instance.name,
  };
  if (state) {
    message.payload =
      type === 'ERROR'
        ? state
        : stringify(
          filterState(
            state,
            type,
            filters,
            stateSanitizer,
            actionSanitizer,
            nextActionId,
            predicate
          ),
          serializeState
        );
  }
  if (type === 'ACTION') {
    message.action = stringify(
      !actionSanitizer ? action : actionSanitizer(action.action, nextActionId - 1),
      serializeAction