Skip to main content
Version: v1

ICancellationToken Interface

Similar to AbortSignal, but using promise instead of events

Signature​

export interface ICancellationToken<T>

Type Parameters​

ParameterDescription
T

Properties​

PropertyTypeDescription
cancelledbooleanTells if this cancellable token is cancelled
waitCancelledPromise<T>Promise that gets fulfilled when this cancellable token is cancelled

Property Details​

cancelled​

Tells if this cancellable token is cancelled

Signature​

readonly cancelled: boolean;

Type: boolean

waitCancelled​

Promise that gets fulfilled when this cancellable token is cancelled

Signature​

readonly waitCancelled: Promise<T>;

Type: Promise<T>