Function fulfillPromise

  • Fulfill a Promise from a JobResult

    If the result is a CancelResult, the promise is rejected with a CancelError. Otherwise it is resolved or rejected according to the state of the result.

    Type Parameters

    • T

    Parameters

    • resolve: ((v: T) => void)

      A value-taking function (first arg to new Promise callback)

        • (v: T): void
        • Parameters

          Returns void

    • reject: ((e: any) => void)

      An error-taking function (second arg to new Promise callback)

        • (e: any): void
        • Parameters

          • e: any

          Returns void

    • res: JobResult<T>

      The job result you want to settle the promise with. An error will be thrown if it's undefined.

      If the result is an error, it is marked as handled.

    Returns void