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> = ...

      Optional: the job to get a native promise for. If none is given, the active job is used.

    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.