• Wait to finish of all given promises. This method does not fail fast like Promise.all, it will wait until all promises are executed.

    Note that the standard Promise.allSettled function may be a superior alternative.

    Type Parameters

    • T

    Parameters

    • promises: (T | PromiseLike<T>)[]

      the promises to wait for.

    Returns CancelablePromise<T[]>

    to wait for all promises to finish.

    import join from "apprt-core/join";
    const a = fetch("test.json");
    const b = fetch("test2.json");

    try {
    const results = await join([a, b]);
    const ajson = results[0];
    const bjson = results[1];
    } catch (e) {
    const joinError: JoinError = e;
    // joinError.all => results, e.g. e.all[0] === result of ajson
    // joinError.error => first of all errors
    // joinError.errors => all errors
    }