Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

operator_pairwise

crates.io ci codecov license

Emit the previous and current values together.

See Also

Example

cargo run -p rx_core --example operator_pairwise_example
let _subscription = (1..=4)
    .into_observable()
    .pairwise()
    .subscribe(PrintObserver::new("pairwise_operator"));

Output:

pairwise_operator - next: [1, 2]
pairwise_operator - next: [2, 3]
pairwise_operator - next: [3, 4]
pairwise_operator - completed
pairwise_operator - unsubscribed