• Applies an accumulator function over an async-iterable sequence, returning the result of the aggregation as a single element in the result sequence. The seed value, if specified, is used as the initial accumulator value. For aggregation behavior with incremental intermediate results, scan.

    Type Parameters

    • T

      The type of the elements in the source sequence.

    • R = T

      The type of the result of the aggregation.

    Parameters

    • source: AsyncIterable<T>

      An async-iterable sequence to aggregate over.

    • options: ReduceOptions<T, R>

      The options which contains a callback, with optional seedn and an optional abort signal for cancellation.

    Returns Promise<R>

    A promise with the final accumulator value.

Generated using TypeDoc