ReactiveActionState

type ReactiveActionState<TResult> = 
  | {
  data: TResult | undefined;
  error: unknown;
  status: "error";
}
  | {
  data: TResult | undefined;
  error: unknown;
  status: "running";
}
  | {
  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 error holds the most recent failure. Both persist through subsequent running states so call sites can keep rendering stale content while a retry is in flight. success clears error; only reset() clears data.

Type Parameters

Type Parameter
TResult

On this page