Package org.drasyl.util
Class ObservableUtil
java.lang.Object
org.drasyl.util.ObservableUtil
Utility class for operations on
Observable
s.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> io.reactivex.rxjava3.core.Observable<Pair<T,
T>> pairWithPreviousObservable
(io.reactivex.rxjava3.core.Observable<T> observable) Creates anObservable
to pair up the current and previous items.
-
Method Details
-
pairWithPreviousObservable
public static <T> io.reactivex.rxjava3.core.Observable<Pair<T,T>> pairWithPreviousObservable(io.reactivex.rxjava3.core.Observable<T> observable) Creates anObservable
to pair up the current and previous items.Source: +---+ +---+ +---+ --+ A +--+ B +--+ C +-> +---+ +---+ +---+ pairWithPreviousObservable: +---+ +---+ +---+ --+ A +--+ B +--+ C +-> | ⊥ | | A | | B | +---+ +---+ +---+
Adapted from http://www.zerobugbuild.com/?p=213- Type Parameters:
T
- the common element type- Parameters:
observable
-Observable
whose current and previous items are to be paired.- Returns:
- the new
Observable
instance
-