#rx-core-operator #rx-bevy-operator #rx-core #rx #rx-bevy

rx_core_operator_tap_next

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

6 releases

Uses new Rust 2024

0.2.1 Feb 1, 2026
0.2.0 Jan 24, 2026
0.1.2 Jan 24, 2026
0.0.1 Jan 19, 2026

#2985 in Game dev


Used in 2 crates (via rx_core)

MIT license

165KB
4.5K SLoC

operator_tap_next

crates.io ci codecov license

Run a callback for each next value while letting signals pass through.

See Also

  • TapOperator - Mirror all signals into another observer.
  • OnNextOperator - Invoke a callback for each value that can also decide whether to forward it.
  • OnSubscribeOperator - Run a callback when a subscription is established.
  • FinalizeOperator - Execute cleanup when the observable finishes or unsubscribes.

Example

cargo run -p rx_core --example operator_tap_next_example
let _subscription = (1..=5)
    .into_observable()
    .tap_next(|next| println!("hello {next}"))
    .subscribe(PrintObserver::new("tap_operator"));

Output:

hello 1
tap_operator - next: 1
hello 2
tap_operator - next: 2
hello 3
tap_operator - next: 3
hello 4
tap_operator - next: 4
hello 5
tap_operator - next: 5
tap_operator - completed
tap_operator - unsubscribed

Dependencies

~255–720KB
~17K SLoC