| Crates.io | rx_core_operator_reduce |
| lib.rs | rx_core_operator_reduce |
| version | 0.2.0 |
| created_at | 2026-01-19 18:00:30.728747+00 |
| updated_at | 2026-01-24 15:09:15.44139+00 |
| description | reduce operator for rx_core |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2055032 |
| size | 14,048 |
Fold values and emit only the final accumulator on completion.
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