Skip to content

Flatten operator #295

@mttkay

Description

@mttkay

This is more a request for discussion.

I'm not sure .NET's Rx has something like this, but one thing I miss in RxJava is an operator to flatten an Observable<List<T>> to Observable<T>. As far as I can tell, this currently requires one to write somewhat clunky code using flatMap:

Observable.from(...).toList().flatMap(new Func1<List<...>, Observable<...>>() {
        @Override
        public Observable<...> call(List<...> list) {
            return Observable.from(list);
        }
    });

i.e. there seems to be no standard reverse operation for toList. Is this something you would deem worth having in the library itself? It would simplify the above call to:

Observable.from(...).toList().flatten()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions