Note: This problem is same for Observable
, with more variations like combineLatest
. So I've picked Single
as the minimal example.
I routinely encounter situations where there is a list of sources of same type and they all must emit before continuing. I resolve it with zip
:
Single.zip(sources) { it.map { it as SomeType } }
This is fragile because the Single.zip(sources, zipper)
is not type-safe so I have to coerce elements on the return value. Isn't there a built-in operator to do that?