Closed thomasnield closed 8 years ago
Thanks @thomasnield for the offer. At the moment I don't really understand the use case and didn't really understand on SO either. When does this crop up?
Maybe its a niche need then so no worries if its not needed. It comes up when I have an Observable<List
Sounds like a straight application of flatMap using a scheduler (without a scheduler it just behaves like concatMap).
On 1 September 2015 at 20:44, Thomas Nield notifications@github.com wrote:
Maybe its a niche need then so no worries if its not needed. It comes up when I have an Observable> where each T item has an Observable> property, and j want to consolidate all instances to a single combined reactive Observable>.
— Reply to this email directly or view it on GitHub https://github.com/davidmoten/rxjava-extras/issues/3#issuecomment-136670101 .
Does that mean there's a better way to compose this? And yeah I think I can see the flatMap() behavior but its flattening and combining only the latest lists, not accumulating the lists and any emitted lists following.
Oh wait... are you suggesting I don't use lists at all and make a finite Observable act as my collection? I'll need to think on that...
Thought I'd offer this particular
Transformer
since I am using it a lot and maybe others might find value in it. David, if you want thisCombinedListTransformer
let me know and I can create a PR.This SO post will provide detailed context on what it does and how it came about. http://stackoverflow.com/questions/32292509/rxjava-consolidating-multiple-infinite-observablelistt/32312586#32312586
Essentially, it transforms an
Observable<List<T>>
with a mapping for eachT
item to anotherObservable<List<R>>
, consolidates each latest emittedList<R>
into a singleList<R>
, and emits thatObservable<List<R>>
result.It was tedious enough to compose that a
Transformer
felt warranted.