Skip to main content
Version: 10.x

splitLink()

Signature

ts
splitLink<TRouter>(opts: object): TRPCLink<TRouter>;
ts
splitLink<TRouter>(opts: object): TRPCLink<TRouter>;

Type parameters

  • TRouter extends Router<AnyRouterDef<AnyRootConfig, any>, TRouter> = AnyRouter

Parameters

NameTypeDescription
optsobject-
opts.condition(op: Operation<unknown>) => 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/src/links/splitLink.ts:9