Skip to content

1.x: add terminal clarification to switchMap operators #3974

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/main/java/rx/Observable.java
Original file line number Diff line number Diff line change
Expand Up @@ -2846,6 +2846,9 @@ public static <T> Observable<Boolean> sequenceEqual(Observable<? extends T> firs
* these emitted Observables, the Observable returned by {@code switchOnNext} begins emitting the items
* emitted by that Observable. When a new Observable is emitted, {@code switchOnNext} stops emitting items
* from the earlier-emitted Observable and begins emitting items from the new one.
* <p>
* The resulting Observable completes if both the outer Observable and the last inner Observable, if any, complete.
* If the outer Observable signals an onError, the inner Observable is unsubscribed and the error delivered in-sequence.
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code switchOnNext} does not operate by default on a particular {@link Scheduler}.</dd>
Expand All @@ -2872,6 +2875,10 @@ public static <T> Observable<T> switchOnNext(Observable<? extends Observable<? e
* these emitted Observables, the Observable returned by {@code switchOnNext} begins emitting the items
* emitted by that Observable. When a new Observable is emitted, {@code switchOnNext} stops emitting items
* from the earlier-emitted Observable and begins emitting items from the new one.
* <p>
* The resulting Observable completes if both the main Observable and the last inner Observable, if any, complete.
* If the main Observable signals an onError, the termination of the last inner Observable will emit that error as is
* or wrapped into a CompositeException along with the other possible errors the former inner Observables signalled.
* <dl>
* <dt><b>Scheduler:</b></dt>
* <dd>{@code switchOnNext} does not operate by default on a particular {@link Scheduler}.</dd>
Expand Down Expand Up @@ -8619,6 +8626,9 @@ public final Observable<T> subscribeOn(Scheduler scheduler) {
* Observable that returns an Observable, and then emitting the items emitted by the most recently emitted
* of these Observables.
* <p>
* The resulting Observable completes if both the upstream Observable and the last inner Observable, if any, complete.
* If the upstream Observable signals an onError, the inner Observable is unsubscribed and the error delivered in-sequence.
* <p>
* <img width="640" height="350" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchMap.png" alt="">
* <dl>
* <dt><b>Scheduler:</b></dt>
Expand All @@ -8640,6 +8650,10 @@ public final <R> Observable<R> switchMap(Func1<? super T, ? extends Observable<?
* Observable that returns an Observable, and then emitting the items emitted by the most recently emitted
* of these Observables and delays any error until all Observables terminate.
* <p>
* The resulting Observable completes if both the upstream Observable and the last inner Observable, if any, complete.
* If the upstream Observable signals an onError, the termination of the last inner Observable will emit that error as is
* or wrapped into a CompositeException along with the other possible errors the former inner Observables signalled.
* <p>
* <img width="640" height="350" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/switchMap.png" alt="">
* <dl>
* <dt><b>Scheduler:</b></dt>
Expand Down