Skip to main content
Version: 11.x

Function: experimental_standaloneMiddleware()

experimental_standaloneMiddleware<TCtx>(): object

Create a standalone middleware

https://trpc.io/docs/v11/server/middlewares#experimental-standalone-middlewares

Type parameters

Parameter
TCtx extends {ctx: object; input: unknown; meta: object;}

Returns

create

create: <$ContextOverrides>(fn) => MiddlewareBuilder< TCtx extends {ctx: T;} ? T : any, TCtx extends {meta: T_1;} ? T_1 : object, $ContextOverrides, TCtx extends {input: T_2;} ? T_2:unknown >

Type parameters

Parameter
$ContextOverrides

Parameters

ParameterType
fnMiddlewareFunction< TCtx extends {ctx: T;} ? T : any, TCtx extends {meta: T_1;} ? T_1 : object, object, $ContextOverrides, TCtx extends {input: T_2;} ? T_2 : unknown >

Returns

MiddlewareBuilder< TCtx extends {ctx: T;} ? T : any, TCtx extends {meta: T_1;} ? T_1 : object, $ContextOverrides, TCtx extends {input: T_2;} ? T_2 : unknown >

Source

packages/core/dist/middleware.d.ts:76


Generated using TypeDoc and typedoc-plugin-markdown