FuncType - v0.8.85
    Preparing search index...

    Type Alias CancellationToken

    The CancellationToken is a control structure that allows long-running tasks to be cancelled Cancellation is cooperative, meaning the task must check the token and respond to cancellation requests

    type CancellationToken = {
        isCancelled: boolean;
        signal: AbortSignal;
        onCancel(callback: () => void): void;
    }
    Index

    Properties

    Methods

    Properties

    isCancelled: boolean

    Whether the token has been cancelled

    signal: AbortSignal

    Signal that can be used with fetch and other abortable APIs

    Methods

    • Register a callback to be called when cancellation occurs

      Parameters

      • callback: () => void

      Returns void