Slide 26
Slide 26 text
/**
* Returns a new Observable by applying a function that you supply to each item emitted
* by the source Observable that returns an Observable, and then emitting the items
* emitted by the most recently emitted of these Observables.
*
* 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.
*
* @param fund
* a function that, when applied to an item emitted by the source Observable,
* returns an Observable
* @return an Observable that emits the items emitted by the Observable returned from
* applying {@code func} to the most recently emitted item emitted by the source
* Observable
*/
public final Observable switchMap(
Func1> func) {
return switchOnNext(map(func));
}