• Reduces chunks in to one accumulator. Once the stream is cancelled, the accumulator will be queued.

    Type Parameters

    • I

    • O

    Parameters

    Returns TransformStream<I, O>

    See

    accumulate:function

    Example

    --a-------b-------c-----|

    reduce([], (acc, chunk) => [...acc, chunk])

    ------------------------[a,b,c]-|

Generated using TypeDoc