• Return a new Job. If either a parent parameter or stop function are given, the new job is linked to the parent.

    Type Parameters

    • T

    Parameters

    • Optional parent: Job<any>

      The parent job to which the new job should be attached. Defaults to the currently-active job if none given (assuming a stop parameter is provided).

    • Optional stop: CleanupFn

      The function to call to destroy the nested job. Defaults to the Job.end method of the new job if none is given (assuming a parent parameter is provided).

    Returns Job<T>

    A new job. The job is linked/nested if any arguments are given, or a detached (parentless) job otherwise.