Function settleAll

  • Wrapper for promise.allSettled that returns typed errors

    Type Parameters

    • T
    • E = Error

    Parameters

    • promises: Promise<T>[]

      Array of promises to settle

    Returns Promise<SettledResult<T, E>>

    const promises = [Promise.resolve(1), Promise.resolve(2), Promise.resolve(3)];
    const { fulfilled, rejected } = await settleAll<number, SfError>(promises);