Skip to main content

workers/host/raceWithSignal

@arolariu/website


@arolariu/website / workers/host/raceWithSignal

workers/host/raceWithSignal

Fileoverview

Race a promise against an AbortSignal with deterministic listener cleanup on the body-wins path.

Remarks

Centralizes the abort-race pattern that previously lived inline in createWorkerHost's call proxy and restart(). WHATWG DOM guarantees signal.reason is defined on an aborted signal; the ?? fallback exists solely for runtimes whose polyfills diverge from spec.

Functions

// was this page useful?