operator_with_latest_from
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