switch Map
Calls the mapper for each element emitted by the Observable and subscribes to the returned inner Observable, disposing any previously subscribed inner Observable. Emits elements of a most recent inner Observable.
Please refer to the corresponding RxJava document.
fun <T, U, R> Observable<T>.switchMap(mapper: (T) -> Observable<U>, resultSelector: (T, U) -> R): Observable<R>
Calls the mapper for each element emitted by the Observable and subscribes to the returned inner Observable, disposing any previously subscribed inner Observable. For each element U emitted by a most recent inner Observable, calls resultSelector with the original source element T and the inner element U, and emits the result element R.
Please refer to the corresponding RxJava document.