Issue
I tried to convert Observable<List<A>> to Flowable<A> in RxJava, however it doesn't work.
return resource.flatMap(
new Function<Observable<List<Product>>, List<Product>>() {
@Override
public List<Product> apply(Observable<List<Product>> products) throws Exception {
return (List<Product>) products;
}
}).toFlowable(BackpressureStrategy.BUFFER)
Solution
You need flatMapIterable:
return resource.flatMapIterable(list -> list)
.toFlowable(BackpressureStrategy.BUFFER)
Answered By - akarnokd
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.