Function series

  • run async operations one by one, serially

    and return the result array

    if any operation raise error, the following operations will not be executed

    Type Parameters

    Parameters

    • Rest ...asyncOperations: T

      async operations

      Rest

    Returns Promise<SeriesResult<T>>

    Since

    5.14.0

    Example

    const [res1, res2, res3] = await series(
    () => fetch(1),
    () => fetch(2),
    () => fetch(3)
    )