Skip to main content
Version: 11.x

Function: splitLink()

splitLink<TRouter>(opts): TRPCLink<TRouter>

Type Parameters

Type ParameterDefault type
TRouter extends AnyRouterAnyRouter

Parameters

ParameterTypeDescription
optsobject-
opts.condition(op) => boolean-
opts.falseTRPCLink<TRouter> | TRPCLink<TRouter>[]The link to execute next if the test function returns false.
opts.trueTRPCLink<TRouter> | TRPCLink<TRouter>[]The link to execute next if the test function returns true.

Returns

TRPCLink<TRouter>

Defined in

packages/client/dist/links/splitLink.d.ts:3