RequestResult
Reactive state for a one-shot request managed by useRequest.
Lifecycle: starts at loading (or disabled when the source is null) and auto-fires on
mount; transitions to loaded on success or error on failure. refresh() re-fires the
request; while a refresh is in flight after a prior success, status is retrying and data
still holds the stale value (stale-while-revalidate).
Type Parameters
| Type Parameter | Description |
|---|---|
T | The value the underlying request resolves to. |
Properties
data
The most recent successful value, or undefined while loading or when disabled.
error
The error from the most recent failed call, or undefined.
isLoading
true only on the very first loading state — false during retrying so spinners don't replace stale content.
refresh()
Re-fire the request. Each call starts a fresh attempt with a fresh perRequestSignal. Stable reference.
Returns
void
status
Lifecycle status as a discriminated string:
loading: first call in flight, no data yet.loaded: call succeeded.error: call failed;refresh()will retry.retrying: re-fire after a prior success or error;datastill holds the stale value.disabled: source wasnull— no request was fired.