rx_core_operator_tap_next

Crates.iorx_core_operator_tap_next
lib.rsrx_core_operator_tap_next
version0.2.0
created_at2026-01-19 19:43:46.516952+00
updated_at2026-01-24 15:10:39.02122+00
descriptiontap next operator for rx_core, for the simple use cases where you don't want to define an entire observable to peek into one.
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2055164
size14,249
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

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
Commit count: 652

cargo fmt