Options
Menu

A CancellationToken is a utility class that allows the binding of a cancel method to a method that returns a Promise. A CancellationToken must be "bound" by passing it into a method that accepts one. The token must be bound before calling cancel.

Hierarchy

  • CancellationToken

Index

Methods

cancel

  • cancel(): void
  • Invokes the bound cancellation behavior. This method will throw an error if the CancellationToken is not bound.

    Returns void

isBound

  • isBound(): boolean
  • Returns boolean

    True if the CancellationToken is bound, false otherwise.

Staticcreate

  • Creates an unbound CancellationToken.

    Returns CancellationToken

    A new CancellationToken that must be bound.