ReactiveActionState

type ReactiveActionState<TResult> = 
  | {
  data: TResult | undefined;
  error: undefined;
  status: "running";
}
  | {
  data: TResult | undefined;
  error: unknown;
  status: "error";
}
  | {
  data: TResult;
  error: undefined;
  status: "success";
}
  | {
  data: undefined;
  error: undefined;
  status: "idle";
};

Discriminated state of a ReactiveActionStore, keyed by ReactiveActionStatus.

data holds the most recent successful result and persists through subsequent running and error states so call sites can keep rendering stale content while a retry is in flight. Only reset() clears it.

Type Parameters

Type Parameter
TResult

On this page