swarpc - v0.10.0
    Preparing search index...

    Type Alias CancelablePromise<T>

    A promise that you can cancel by calling .cancel(reason) on it:

    const { request, cancel } = client.runProcedure.cancelable(input, onProgress)
    setTimeout(() => cancel("Cancelled by user"), 1000)
    const result = await request
    type CancelablePromise<T = unknown> = {
        request: Promise<T>;
        cancel: (reason: string) => void;
    }

    Type Parameters

    • T = unknown
    Index

    Properties

    Properties

    request: Promise<T>
    cancel: (reason: string) => void

    Abort the request.

    Type declaration

      • (reason: string): void
      • Parameters

        • reason: string

          The reason for cancelling the request.

        Returns void