February 2020
Intermediate to advanced
412 pages
9h 36m
English
Zipping allows you to take an emitted value from each Observable source and combine them into a single emission. Each Observable can emit a different type, but you can combine these different emitted types into a single emission. Here is an example. If we have an Observable<String> and an Observable<Integer>, we can zip each String and Integer together in a one-to-one pairing. Then, we can combine them using the BiFunction<String,Integer,String> zipper function. This function is implemented in this example as (s,i) -> s + "-" + i, which concatenates the received two input values into one String value with a separator, "-", in the middle:
import io.reactivex.rxjava3.core.Observable;public class Ch4_13 { public static void ...
Read now
Unlock full access