splitLink()
Signature
ts
splitLink<TRouter>(opts: object): TRPCLink<TRouter>;
ts
splitLink<TRouter>(opts: object): TRPCLink<TRouter>;
Type parameters
TRouter
extendsRouter
<AnyRouterDef
<AnyRootConfig
,any
>,TRouter
> =AnyRouter
Parameters
Name | Type | Description |
---|---|---|
opts | object | - |
opts.condition | (op : Operation <unknown >) => boolean | - |
opts.false | TRPCLink <TRouter > | TRPCLink <TRouter >[] | The link to execute next if the test function returns false . |
opts.true | TRPCLink <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