rx_core_operator_reduce

Crates.iorx_core_operator_reduce
lib.rsrx_core_operator_reduce
version0.2.0
created_at2026-01-19 18:00:30.728747+00
updated_at2026-01-24 15:09:15.44139+00
descriptionreduce operator for rx_core
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2055032
size14,048
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

operator_reduce

crates.io ci codecov license

Fold values and emit only the final accumulator on completion.

See Also

  • ScanOperator - Accumulate state and emit every intermediate result.

Example

cargo run -p rx_core --example operator_reduce_example
let _subscription = (0..=10)
    .into_observable()
    .reduce(|acc, next| acc + next, 0)
    .subscribe(PrintObserver::new("reduce_operator"));

Output:

reduce_operator - next: 55
reduce_operator - completed
reduce_operator - unsubscribed
Commit count: 652

cargo fmt