redux-devtools-instrument

  • Version 1.10.0
  • Published
  • 147 kB
  • 2 dependencies
  • MIT license

Install

npm i redux-devtools-instrument
yarn add redux-devtools-instrument
pnpm add redux-devtools-instrument

Overview

Redux DevTools instrumentation

Index

Variables

variable ActionCreators

const ActionCreators: {
performAction<A extends any>(
action: A,
trace?: boolean | ((action: A) => string | undefined),
traceLimit?: number | undefined,
toExcludeFromTrace?: Function | undefined
): {
type: 'PERFORM_ACTION';
action: A;
timestamp: number;
stack: string | undefined;
};
reset(): ResetAction;
rollback(): RollbackAction;
commit(): CommitAction;
sweep(): SweepAction;
toggleAction(id: number): ToggleAction;
setActionsActive(
start: number,
end: number,
active?: boolean
): SetActionsActiveAction;
reorderAction(actionId: number, beforeActionId: number): ReorderAction;
jumpToState(index: number): JumpToStateAction;
jumpToAction(actionId: number): JumpToActionAction;
importState<S, A_1 extends any, MonitorState = null>(
nextLiftedState: LiftedState<S, A_1, MonitorState> | readonly A_1[],
noRecompute?: boolean | undefined
): ImportStateAction<S, A_1, MonitorState>;
lockChanges(status: boolean): LockChangesAction;
pauseRecording(status: boolean): PauseRecordingAction;
};
  • Action creators to change the History state.

variable ActionTypes

const ActionTypes: {
readonly PERFORM_ACTION: 'PERFORM_ACTION';
readonly RESET: 'RESET';
readonly ROLLBACK: 'ROLLBACK';
readonly COMMIT: 'COMMIT';
readonly SWEEP: 'SWEEP';
readonly TOGGLE_ACTION: 'TOGGLE_ACTION';
readonly SET_ACTIONS_ACTIVE: 'SET_ACTIONS_ACTIVE';
readonly JUMP_TO_STATE: 'JUMP_TO_STATE';
readonly JUMP_TO_ACTION: 'JUMP_TO_ACTION';
readonly REORDER_ACTION: 'REORDER_ACTION';
readonly IMPORT_STATE: 'IMPORT_STATE';
readonly LOCK_CHANGES: 'LOCK_CHANGES';
readonly PAUSE_RECORDING: 'PAUSE_RECORDING';
};

    variable INIT_ACTION

    const INIT_ACTION: { type: string };

      Functions

      function instrument

      instrument: <
      OptionsS,
      OptionsA extends any,
      MonitorState = null,
      MonitorAction extends any = never
      >(
      monitorReducer?: any,
      options?: Options<OptionsS, OptionsA, MonitorState, MonitorAction>
      ) => any;
      • Redux instrumentation store enhancer.

      function liftAction

      liftAction: <A extends any>(
      action: A,
      trace?: boolean | ((action: A) => string | undefined),
      traceLimit?: number,
      toExcludeFromTrace?: Function
      ) => {
      type: 'PERFORM_ACTION';
      action: A;
      timestamp: number;
      stack: string | undefined;
      };
      • Lifts an app's action into an action on the lifted store.

      function liftReducerWith

      liftReducerWith: <S, A extends any, MonitorState, MonitorAction extends any>(
      reducer: any,
      initialCommittedState: PreloadedState<S> | undefined,
      monitorReducer: any,
      options: Options<S, A, MonitorState, MonitorAction>
      ) => any;
      • Creates a history state reducer from an app's reducer.

      function unliftState

      unliftState: <S, A extends any, MonitorState, NextStateExt>(
      liftedState: LiftedState<S, A, MonitorState> & NextStateExt
      ) => S & NextStateExt;
      • Provides an app's view into the state of the lifted store.

      function unliftStore

      unliftStore: <
      S,
      A extends any,
      MonitorState,
      MonitorAction extends any,
      NextExt,
      NextStateExt
      >(
      liftedStore: Store<
      LiftedState<S, A, MonitorState> & NextStateExt,
      LiftedAction<S, A, MonitorState>
      > &
      NextExt,
      liftReducer: (r: any) => any,
      options: Options<S, A, MonitorState, MonitorAction>
      ) => Store<S & NextStateExt, A> &
      NextExt & {
      liftedStore: Store<
      LiftedState<S, A, MonitorState> & NextStateExt,
      LiftedAction<S, A, MonitorState>
      >;
      };
      • Provides an app's view into the lifted store.

      Interfaces

      interface LiftedState

      interface LiftedState<S, A extends Action<unknown>, MonitorState> {}

        property actionsById

        actionsById: {
        [actionId: number]: PerformAction<A>;
        };

          property committedState

          committedState: S;

            property computedStates

            computedStates: {
            state: S;
            error?: string;
            }[];

              property currentStateIndex

              currentStateIndex: number;

                property isLocked

                isLocked: boolean;

                  property isPaused

                  isPaused: boolean;

                    property monitorState

                    monitorState: MonitorState;

                      property nextActionId

                      nextActionId: number;

                        property skippedActionIds

                        skippedActionIds: number[];

                          property stagedActionIds

                          stagedActionIds: number[];

                            interface Options

                            interface Options<
                            S,
                            A extends Action<unknown>,
                            MonitorState,
                            MonitorAction extends Action<unknown>
                            > {}

                              property maxAge

                              maxAge?:
                              | number
                              | ((
                              currentLiftedAction: LiftedAction<S, A, MonitorState>,
                              previousLiftedState: LiftedState<S, A, MonitorState> | undefined
                              ) => number);

                                property pauseActionType

                                pauseActionType?: unknown;

                                  property shouldCatchErrors

                                  shouldCatchErrors?: boolean;

                                    property shouldHotReload

                                    shouldHotReload?: boolean;

                                      property shouldIncludeCallstack

                                      shouldIncludeCallstack?: boolean;

                                        property shouldRecordChanges

                                        shouldRecordChanges?: boolean;

                                          property shouldStartLocked

                                          shouldStartLocked?: boolean;

                                            property trace

                                            trace?: boolean | ((action: A) => string | undefined);

                                              property traceLimit

                                              traceLimit?: number;

                                                interface PerformAction

                                                interface PerformAction<A extends Action<unknown>> {}

                                                  property action

                                                  action: A;

                                                    property stack

                                                    stack: string | undefined;

                                                      property timestamp

                                                      timestamp: number;

                                                        property type

                                                        type: typeof ActionTypes.PERFORM_ACTION;

                                                          Type Aliases

                                                          type EnhancedStore

                                                          type EnhancedStore<S, A extends Action<unknown>, MonitorState> = Store<S, A> &
                                                          InstrumentExt<S, A, MonitorState>;

                                                            type InstrumentExt

                                                            type InstrumentExt<S, A extends Action<unknown>, MonitorState> = {
                                                            liftedStore: LiftedStore<S, A, MonitorState>;
                                                            };

                                                              type LiftedAction

                                                              type LiftedAction<S, A extends Action<unknown>, MonitorState> =
                                                              | PerformAction<A>
                                                              | ResetAction
                                                              | RollbackAction
                                                              | CommitAction
                                                              | SweepAction
                                                              | ToggleAction
                                                              | SetActionsActiveAction
                                                              | ReorderAction
                                                              | JumpToStateAction
                                                              | JumpToActionAction
                                                              | ImportStateAction<S, A, MonitorState>
                                                              | LockChangesAction
                                                              | PauseRecordingAction;

                                                                type LiftedReducer

                                                                type LiftedReducer<S, A extends Action<unknown>, MonitorState> = Reducer<
                                                                LiftedState<S, A, MonitorState>,
                                                                LiftedAction<S, A, MonitorState>
                                                                >;

                                                                  type LiftedStore

                                                                  type LiftedStore<S, A extends Action<unknown>, MonitorState> = Store<
                                                                  LiftedState<S, A, MonitorState>,
                                                                  LiftedAction<S, A, MonitorState>
                                                                  >;

                                                                    Package Files (1)

                                                                    Dependencies (2)

                                                                    Dev Dependencies (4)

                                                                    Peer Dependencies (1)

                                                                    Badge

                                                                    To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                                                                    You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/redux-devtools-instrument.

                                                                    • Markdown
                                                                      [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/redux-devtools-instrument)
                                                                    • HTML
                                                                      <a href="https://www.jsdocs.io/package/redux-devtools-instrument"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>