Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hex/src/service/deps.ts>oak.composeMiddleware

An ecosystem delivering practices, philosophy and portability.
Go to Latest
function oak.composeMiddleware
import { oak } from "https://deno.land/x/hex@0.5.15/src/service/deps.ts";
const { composeMiddleware } = oak;

Compose multiple middleware functions into a single middleware function.

Type Parameters

optional
S extends State = Record<string, any>
optional
T extends Context = Context<S>

Parameters

middleware: Middleware<S, T>[]

Returns

(context: T, next?: () => Promise<unknown>) => Promise<unknown>