Can someone help me find the proper solution for this problem I face?
- I have a backend service that give me
Observables
of the data I need, which areEvents
. - Form the Event I can get an
EventGroup
, which contains Ids of all events in the same group. - Next I can get all the
Event
s that are part of this group.
However, I get a Observable<List<Observable<Event>>>
, where I'd like to get a Observable<List<Event>>
. How can I achive this, without actually subscribing to the nested Observables
?
val events : Observable<List<Observable<Event>>> =
eventProvider.observable
.flatMap { myBackend.getEventGroup(it.eventGroupId) }
.map {
it.eventIds.map { myBackend.getEvent(it) }
}
TL:DR
How do I get Observable<List<X>>
from a Observable<List<Observable<X>>>
?