In the following code the "three" and "done" never appears in the output. Looks like the problem is in toList call. Am i using it wrong?
PublishSubject<Boolean> mBooleanPublishSubject = PublishSubject.create();
Observable<Boolean> observable = mBooleanPublishSubject.asObservable().share();
observable
.doOnNext(__ -> System.out.println("one"))
.flatMap(__ -> Observable.just(Arrays.asList(1, 2, 3, 4)))
.flatMapIterable(number -> number)
.doOnNext(v -> System.out.println("two " + v))
.toList()
.doOnNext(v -> System.out.println("three " + v))
.subscribe(v -> System.out.println("done"));
mBooleanPublishSubject.onNext(true);
In the following code the "three" and "done" never appears in the output. Looks like the problem is in
toListcall. Am i using it wrong?