Core fetch-on-mount hook with cancellation, polling, and retry.
Every domain hook in @playlive/react-data is a thin shell around
this primitive. Surface lifted directly out of TanStack Query's
useQuery for API-compatibility.
behavior:
key changes ⇒ abort in-flight + refetch.
enabled = false ⇒ never fetch + reset isLoading to false.
refetchInterval > 0 ⇒ poll on a timer; the timer is reset
after each successful resolve (no overlapping fetches).
Errors trigger up to retry retries with exponential backoff.
Unmount aborts any in-flight request and cancels pending timers.
Type Parameters
T
Resolved payload type.
Parameters
key: readonlyunknown[]
Stable identity for the request. Any change (deep
equality on the serialized form) triggers a refetch.
Core fetch-on-mount hook with cancellation, polling, and retry.
Every domain hook in
@playlive/react-datais a thin shell around this primitive. Surface lifted directly out of TanStack Query'suseQueryfor API-compatibility.behavior:
keychanges ⇒ abort in-flight + refetch.enabled = false⇒ never fetch + resetisLoadingtofalse.refetchInterval > 0⇒ poll on a timer; the timer is reset after each successful resolve (no overlapping fetches).retryretries with exponential backoff.