rx_core_operator_with_latest_from

Crates.iorx_core_operator_with_latest_from
lib.rsrx_core_operator_with_latest_from
version0.2.0
created_at2026-01-19 20:50:45.323317+00
updated_at2026-01-24 15:10:50.566808+00
descriptionwith_latest_from operator for rx_core
homepagehttps://github.com/AlexAegis/rx_bevy
repositoryhttps://github.com/AlexAegis/rx_bevy
max_upload_size
id2055329
size18,453
Sandor (AlexAegis)

documentation

https://github.com/AlexAegis/rx_bevy

README

operator_with_latest_from

crates.io ci codecov license

Example

cargo run -p rx_core --example operator_with_latest_from_example
let mut source = PublishSubject::<usize, &'static str>::default();
let mut inner = PublishSubject::<&'static str, &'static str>::default();

let _subscription = source
    .clone()
    .with_latest_from(inner.clone())
    .subscribe(PrintObserver::new("with_latest_from_operator"));

source.next(1);
inner.next("hello");
source.next(2);
source.next(3);
source.next(4);
inner.next("bello");
source.next(5);
inner.error("error");

Output:

with_latest_from_operator - next: (2, "hello")
with_latest_from_operator - next: (3, "hello")
with_latest_from_operator - next: (4, "hello")
with_latest_from_operator - next: (5, "bello")
with_latest_from_operator - error: "error"
with_latest_from_operator - unsubscribed
Commit count: 652

cargo fmt