splitLink()
Signature
tssplitLink<TRouter>(opts: object): TRPCLink<TRouter>;
tssplitLink<TRouter>(opts: object): TRPCLink<TRouter>;
Type parameters
TRouterextendsRouter<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/dist/links/splitLink.d.ts:3