The two previous methods, zip()
and merge()
, work in the domain of the emitted items. There are scenarios in which we have to also consider the time before deciding how to operate on values. RxJava's join()
function combines items from two Observables, working with time windows.
To properly understand the previous figure, let's explain which parameters join()
takes:
The second Observable to combine with the source Observable
A
Func1
parameter that returns an Observable that specifies a time span defining the time window during which the item emitted by the source Observable will interact with the items from the second ObservableA
Func1
parameter that returns an Observable that specifies a time span defining the time window during which the item emitted by the second Observable will interact with the items from the source ObservableA
Func2
parameter that defines how the emitted items will be combined together to emit a new item
As a practical example, we can modify our loadList()
function...