I have a usecase where I get list of userids from 1 Api as a Single<List> and I need to fetch all the users from a different Api which returns Single.
fun fetchUserIds(): Single<List<String>>
fun fetchUser(id: String): Single<User>
I need to return a List eventually. What is the ideal way to do this using RxJava?
You can use
Flowableto iterate over the userIds and call thefetchUseron each element. Then you can combine the result (e.gtoListorcollect):