Function nativePromise

  • Obtain a native promise for a job

    While jobs have the same interface as native promises, there are occasionally reasons to just use one directly. (Like when Uneventful uses this function to implement jobs' promise methods!)

    Type Parameters

    • T

    Parameters

    • job: Job<T>

      The job to get a native promise for.

    Returns Promise<T>

    A Promise that resolves or rejects according to whether the job returns or throws. If the job is canceled, the promise is rejected with a CancelError.