@buntal/core - Http

h

Higher-order function for composing and chaining AtomicHandler functions in Buntal applications.

Source

View source on GitHub

Type Definition

function h<P = Record<string, string>, T = unknown>(
  ...handlers: AtomicHandler<P, T>[]
): AtomicHandler<P, T, Response | Promise<Response>>

Parameters

ParameterTypeRequiredDefaultDescription
handlersAtomicHandler<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

ParameterTypeRequiredDefaultDescription
...handlersAtomicHandler<P, T>[]-Variable number of handler functions to execute in order

Returns

AtomicHandler<P, T, Response | Promise<Response>>

Last modified: 2025-06-10

Content-Length: 0