Combine a list of Observables and wait until all completed

前端 未结 8 1093
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-04 06:35

TL;DR How to convert Task.whenAll(List) into RxJava?

My existing code uses Bolts to build up a list of asynchr

8条回答
  •  长情又很酷
    2020-12-04 06:54

    With Kotlin

    Observable.zip(obs1, obs2, BiFunction { t1 : Boolean, t2:Boolean ->
    
    })
    

    It's important to set the type for the function's arguments or you will have compilation errors

    The last argument type change with the number of argument : BiFunction for 2 Function3 for 3 Function4 for 4 ...

提交回复
热议问题