| Crates.io | rx_core_operator_on_next |
| lib.rs | rx_core_operator_on_next |
| version | 0.2.0 |
| created_at | 2026-01-19 17:43:57.566495+00 |
| updated_at | 2026-01-24 15:08:51.786438+00 |
| description | on_next operator for rx_core |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2055021 |
| size | 15,072 |
Invoke a callback for each value that can also decide whether to forward it.
true allows the value to be forwarded to the destination observer.false prevents the value from being forwarded.Like
filter, but with access to the destination observer!
next value while letting signals pass through.cargo run -p rx_core --example operator_on_next_example
let _subscription = (1..=5)
.into_observable()
.on_next(|next, destination| {
destination.next(next * 99);
true
})
.subscribe(PrintObserver::new("on_next_operator"));
Output:
on_next_operator - next: 99
on_next_operator - next: 1
on_next_operator - next: 198
on_next_operator - next: 2
on_next_operator - next: 297
on_next_operator - next: 3
on_next_operator - next: 396
on_next_operator - next: 4
on_next_operator - next: 495
on_next_operator - next: 5
on_next_operator - completed
on_next_operator - unsubscribed