Skip to main content
Version: 11.x

Interface: UseTRPCSubscriptionOptions<TOutput, TError>

Type Parameters

Type Parameter
TOutput
TError

Properties

enabled?

optional enabled: boolean

Deprecated

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

Defined in

packages/react-query/src/shared/hooks/types.ts:169


onData()?

optional onData: (data) => void

Called when new data is received

Parameters

ParameterType
dataTOutput

Returns

void

Defined in

packages/react-query/src/shared/hooks/types.ts:177


onError()?

optional onError: (err) => void

Called when an unrecoverable error occurs and the subscription is closed

Parameters

ParameterType
errTError

Returns

void

Defined in

packages/react-query/src/shared/hooks/types.ts:181


onStarted()?

optional onStarted: () => void

Called when the subscription is started

Returns

void

Defined in

packages/react-query/src/shared/hooks/types.ts:173