Function propagateResult

  • Propagate a JobResult to another job

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

    Type Parameters

    • T

    Parameters

    • job: Job<T>

      The job to terminate. If it's already ended, nothing changes: the result is not propagated and the error (if any) is not marked as handled.

    • res: JobResult<T>

      The job result you want to settle the job with. An error will be thrown if it's undefined. If the result is an error, it is marked as handled.

    Returns void