I have a Flowable<List<Item>>
for which I want to :
This is not working now because it looks like is entering in an infinite loop::
return list.concatMap(list ->
Observable.fromIterable(list)
.map(item -> {
item.setValue(value);
return item;
}).toList().toFlowable()
.flatMap(updatedList -> mLocalDataSource.update(updatedList)))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread());
I don't think there's any advantage over just doing this work in the flatMap()
/concatMap()
. All I'd say is that it would be cleaner if Item
were immutable.
list.concatMap(items -> {
for(Item item : items)
item.setValue(value);
return mLocalDataSource.update(items)
});