Last date modified: 2025-Jul-02

Interface: ICancellationToken

Cancellation token that can be used to listen for and handle cancellation requests

Properties

isCancellationRequested

readonlyisCancellationRequested: boolean

Whether or not cancellation has been requested

Methods

offCancellation()

offCancellation(handler): void

Unregisters an event handler that runs when token cancellation is requested

Parameters

handler: EventHandler

Handler to unregister

Returns

void


onCancellation()

onCancellation(handler): void

Registers an event handler that runs when token cancellation is requested

Parameters

handler: EventHandler

Handler to register

Returns

void


throwIfCancellationRequested()

throwIfCancellationRequested(): void

Throws an OperationCancelledError if cancellation has been requested

Returns

void

Return to top of the page
Feedback