Aller au contenu principal
Version : 11.x

Interface: UseTRPCSubscriptionOptions<TOutput, TError>

Defined in: packages/react-query/src/shared/hooks/types.ts:162

Type Parameters​

Type Parameter
TOutput
TError

Properties​

enabled?​

optional enabled: boolean

Defined in: packages/react-query/src/shared/hooks/types.ts:168

Deprecated​

use a skipToken from @tanstack/react-query instead this will be removed in v12


onComplete()?​

optional onComplete: () => void

Defined in: packages/react-query/src/shared/hooks/types.ts:184

Called when the subscription is completed on the server

Returns​

void


onData()?​

optional onData: (data) => void

Defined in: packages/react-query/src/shared/hooks/types.ts:176

Called when new data is received

Parameters​

ParameterType
dataTOutput

Returns​

void


onError()?​

optional onError: (err) => void

Defined in: packages/react-query/src/shared/hooks/types.ts:180

Called when an unrecoverable error occurs and the subscription is closed

Parameters​

ParameterType
errTError

Returns​

void


onStarted()?​

optional onStarted: () => void

Defined in: packages/react-query/src/shared/hooks/types.ts:172

Called when the subscription is started

Returns​

void