Observable<List<X>> to Observable<X> that emits each element in List<X>
See original GitHub issueIs there a utility operator for converting from Observable<List<X>>
to an Observable<X>
that emits each element in List<X>
?
Otherwise, are there any obvious optimizations for something like:
getChannels().switchMap(channels -> Observable.from(channels))
flatMap()
could be used as well, depending.
Issue Analytics
- State:
- Created 9 years ago
- Reactions:9
- Comments:11 (6 by maintainers)
Top Results From Across the Web
java - RxJava - fetch every item on the list - Stack Overflow
Observable.flatMapIterable: Returns an Observable that merges each item emitted by the source ObservableSource with the values in an Iterable ...
Read more >Observable - RxJS
RxJS introduces Observables, a new Push system for JavaScript. An Observable is a Producer of multiple values, "pushing" them to Observers (Consumers). A ......
Read more >Just operator - ReactiveX
The Just operator converts an item into an Observable that emits that item. Just is similar to From, but note that From will...
Read more >ObservableList (JavaFX 8) - Oracle Help Center
A convenient method for var-arg adding of elements. void, addListener(ListChangeListener<? super E> listener). Add a listener to this observable list.
Read more >Observable - Monix
_ // We first build an observable that emits a tick per second, // the series of ... fromIterable(List(1, 2, 3)) // obs:...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For anyone else who comes across this thread, I think that
flatMapIterable
will do the trick. You should be able to call.listObservable.flatMapIterable(items -> items)
and get a stream of the items from the list that way.You can also use
flatMapIterable
likegetChannels().flatMapIterable(l -> l)
.