These are chat archives for ReactiveX/RxJava

9th
Feb 2016
Dorus
@Dorus
Feb 09 2016 15:48

Got a question myself now:

    public static <T> Observable<T> obs(Observable<T> cold) {
        return obs2(cold).flatMap(e -> e);
    }

    private static <T> Observable<Observable<T>> obs2(Observable<T> cold) {
        return Observable.create((ob) -> {
            ob.onNext(cold);
            ob.onCompleted();
        });
    }

I would like to inline the obs2 function, but I'm unable to do so because i get type errors. Did i reach the limit of the Java type system, or is there a way to hint it in the right direction?