Skip to content

basalt / ai/src / withAbort

Function: withAbort() ​

> withAbort<T>(signal, run): Promise<T>

Defined in: ai/src/generate.ts:54

Race a task against an abort signal so cancellation is prompt even if the underlying provider doesn't honour the signal itself.

Type Parameters ​

T ​

T

Parameters ​

signal ​

AbortSignal | undefined

run ​

() => Promise<T>

Returns ​

Promise<T>

Released under the MIT License.