Taha
09/19/2019, 3:11 PMfun getCenterServiceCategories() : Single<CenterServiceCategories>
// ..
data class CenterServiceCategories(
val meta: MetaResponse,
val data: List<ServiceCategory>
)
what I want to do
The ServiceCategory also has a list of ids that I want to loop through and eventually return a flatmap that has the list of categories with their services embedded.
The problem is that I cannot call
getCenterServiceCategories().flatmap{
//...
}
since the list is actually the data property.
i have tried subscribing and getting the data onSubscribe and using Kotlins map and flatmap, but I want to do that with RX
any suggestions?Luca Nicoletti
09/19/2019, 3:15 PMflatmap{}
you can cycle though the list and do whatever you wantTaha
09/19/2019, 3:20 PMLuca Nicoletti
09/19/2019, 3:20 PMflatmap{}
you can do it.data.forEach{}
Luca Nicoletti
09/19/2019, 3:20 PM