R
fn

runHookPhase

v0.1.0

Runs all instance-level (plugin) hooks for a single phase, then the optional user per-request hook(s). Avoids allocating an intermediate array per call.

Signature

ts
export async function runHookPhase<C>(
  instance: ReadonlyArray<FetchHook<C>> | undefined,
  user: FetchHook<C> | ReadonlyArray<FetchHook<C>> | undefined,
  context: C,
): Promise<void>{ ... }

Type Parameters

C

Parameters

ParameterTypeDescription
instancereadonly FetchHook<C>[] | undefined
userFetchHook<C> | readonly FetchHook<C>[] | undefined
contextC

Returns

Promise<void>