Reduce stream data into one chunk via the iterative application of function fn to an accumulator and each chunk

See also base::Reduce

reduce_stream(fn, base_value = 0L, ...)

Arguments

fn

a function that is applied to the current accumulation and the current chunk

base_value

the base value of the accumulation

...

arguments passed to TransformStream

Examples

as_reader(1:100) %|>%
    reduce_stream(sum) |>
    on("data", print)