| Crates.io | rx_core_operator_tap |
| lib.rs | rx_core_operator_tap |
| version | 0.2.0 |
| created_at | 2026-01-19 19:43:28.242525+00 |
| updated_at | 2026-01-24 15:10:31.951405+00 |
| description | tap next operator for rx_core, for the simple use cases where you don't want to define an entire observable to peek into one. |
| homepage | https://github.com/AlexAegis/rx_bevy |
| repository | https://github.com/AlexAegis/rx_bevy |
| max_upload_size | |
| id | 2055163 |
| size | 15,933 |
The tap operator lets you forward upstream values to a destination observer.
The destination could be anything, a
PrintObserver
to log upstream values to the console, or even a subject to trigger another
pipeline.
unsubscribe on the
destination, even if it's a subscriber that upgrades to itself and has an
unsubscribe implementation.
However, the error and complete signals are forwarded. If
you want to avoid forwarding error and complete, use
tap_next
instead.next value while letting signals pass through.cargo run -p rx_core --example operator_tap_example
(1..=3)
.into_observable()
.tap(PrintObserver::new("tap_destination"))
.subscribe(PrintObserver::new("tap_operator"));
Output:
tap_destination - next: 1
tap_operator - next: 1
tap_destination - next: 2
tap_operator - next: 2
tap_destination - next: 3
tap_operator - next: 3
tap_destination - completed
tap_operator - completed
tap_operator - unsubscribed
Documentation on UpgradeableObserver ↩