I'm doing a query that returns a list of objects. Now I need to go through those objects and make another request in background for each object. But when doing the flatmap you are returning the list of items, so I need an operator before to go through that list as a for. Any ideas?
public static Single<List<Item>> getRx() {
return Single.create(singleSubscriber -> {
query.findInBackground(new FindCallback<Item>() {
@Override
public void done(List<Item> objects, Error e) {
singleSubscriber.onSuccess(objects);
}
});
});
}
And here the error:
getRx()
.flatMap(item -> { //da error aqui ya que no es un item, es una lista de items
return otherQuery(item);
});