Type Alias unstable_MiddlewareFunction<Result>

unstable_MiddlewareFunction<Result>: ((args: DataFunctionArgs<unstable_RouterContextProvider>, next: unstable_MiddlewareNextFunction<Result>) => MaybePromise<Result | void>)

Route middleware function signature. Receives the same "data" arguments as a loader/action (request, params, context) as the first parameter and a next function as the second parameter which will call downstream handlers and then complete middlewares from the bottom-up

Type Parameters

  • Result = unknown