rx_core_operator_on_subscribe

Crates.iorx_core_operator_on_subscribe
lib.rsrx_core_operator_on_subscribe
version0.2.0
created_at2026-01-19 17:44:14.772913+00
updated_at2026-01-24 15:08:58.851831+00
descriptionon_subscribe operator for rx_core
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2055023
size12,908
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

operator_on_subscribe

crates.io ci codecov license

Run a callback when a subscription is established.

See Also

  • TapOperator - Mirror all signals into another observer.
  • TapNextOperator - Run a callback for each next value while letting signals pass through.
  • OnNextOperator - Invoke a callback for each value that can also decide whether to forward it.
  • FinalizeOperator - Execute cleanup when the observable finishes or unsubscribes.

Example

cargo run -p rx_core --example operator_on_subscribe_example
let _subscription = (1..=5)
    .into_observable()
    .on_subscribe(|destination| destination.next(99))
    .subscribe(PrintObserver::new("on_subscribe_operator"));

Output:

on_subscribe_operator - next: 99
on_subscribe_operator - next: 1
on_subscribe_operator - next: 2
on_subscribe_operator - next: 3
on_subscribe_operator - next: 4
on_subscribe_operator - next: 5
on_subscribe_operator - completed
on_subscribe_operator - unsubscribed
Commit count: 652

cargo fmt