h
Higher-order function for composing and chaining AtomicHandler functions in Buntal applications.
Source
Type Definition
function h<P = Record<string, string>, T = unknown>(
...handlers: AtomicHandler<P, T>[]
): AtomicHandler<P, T, Response | Promise<Response>>
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
handlers | AtomicHandler<P, T>[] | ✅ | - | One or more handler functions to compose and execute in sequence |
Methods
h
Composes multiple AtomicHandler functions into a single handler that executes them sequentially. If any handler returns a Response, execution stops and that Response is returned. If no handler returns a Response, a 204 No Content response is returned.
Parameters
Parameter | Type | Required | Default | Description |
---|---|---|---|---|
...handlers | AtomicHandler<P, T>[] | ✅ | - | Variable number of handler functions to execute in order |
Returns
AtomicHandler<P, T, Response | Promise<Response>>
Last modified: 2025-06-10