Optional
enabledOptional
onThis function will fire any time the subscription successfully fetches new data or the cache is updated via setQueryData.
Optional
onThis callback will fire if the subscription encounters an error and will be passed the error.
Optional
placeholderIf set, this value will be used as the placeholder data for this particular query observer while the subscription is still in the loading
data and no initialData has been provided.
Optional
retryIf false
, failed subscriptions will not retry by default.
If true
, failed subscriptions will retry infinitely.
If set to an integer number, e.g. 3, failed subscriptions will retry until the failed subscription count meets that number.
If set to a function (failureCount: number, error: TError) => boolean
failed subscriptions will retry until the function returns false.
Optional
retryIf number, applies delay before next attempt in milliseconds.
If function, it receives a retryAttempt
integer and the actual Error and returns the delay to apply before the next attempt in milliseconds.
Optional
retryIf set to false
, the subscription will not be retried on mount if it contains an error.
Defaults to true
.
Optional
selectThis option can be used to transform or select a part of the data returned by the query function.
Generated using TypeDoc
Set this to
false
to disable automatic resubscribing when the subscription mounts or changes subscription keys. To refetch the subscription, use therefetch
method returned from theuseSubscription
instance. Defaults totrue
.