Android RxJava zip 操作符

不说话,直接举例

// zip 2 observables
Observable.zip(Observable.just(0), Observable.just(0), BiFunction {
t1: Int, t2: Int -> (t1 + t2)
})

// zip 3 observables
Observable.zip(Observable.just(0), Observable.just(0), Observable.just(0), object: Function3 {
override fun apply(t1: Int, t2: Int, t3: Int): Int {
return 0
}
})

// zip observable list
val list = arrayListOf()
Observable.zip(list) { _ -> 0 }

转载于:https://www.cnblogs.com/davesuen/p/10793178.html

你可能感兴趣的:(Android RxJava zip 操作符)