Skip to content

raceAbort

raceAbort<T>(promise, signal): Promise<T>

Defined in: packages/core/src/async/abort.ts:11

Race a pending promise against an AbortSignal so the caller sees an AbortError the instant the signal aborts — even when the underlying driver cannot cancel the in-flight request. The original promise is not cancelled for drivers without native signal support (libsql/sqlite); it resolves in the background, but its result is discarded.

When signal is undefined, the promise is returned unchanged (no overhead for the common case).

T

Promise<T>

AbortSignal | undefined

Promise<T>