function
stable
Projects each source value to an Observable which is merged in the output Observable only if the previous projected Observable has completed.
exhaustMap<T, R, O extends ObservableInput<any>>(project: (value: T, index: number) => O, resultSelector?: (outerValue: T, innerValue: ObservedValueOf<O>, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, ObservedValueOf<O> | R>
project | A function that, when applied to an item emitted by the source Observable, returns an Observable. |
resultSelector | Optional. Default is Type: |
OperatorFunction<T, ObservedValueOf<O> | R>
: An Observable containing projected Observables of each item of the source, ignoring projected Observables that start before their preceding Observable has completed.
Maps each value to an Observable, then flattens all of these inner Observables using exhaust
.
Returns an Observable that emits items based on applying a function that you supply to each item emitted by the source Observable, where that function returns an (so-called "inner") Observable. When it projects a source value to an Observable, the output Observable begins emitting the items emitted by that projected Observable. However, exhaustMap
ignores every new projected Observable if the previous projected Observable has not yet completed. Once that one completes, it will accept and flatten the next projected Observable and repeat this process.
Run a finite timer for each click, only if there is no currently active timer
import { fromEvent, interval } from 'rxjs'; import { exhaustMap, take } from 'rxjs/operators'; const clicks = fromEvent(document, 'click'); const result = clicks.pipe( exhaustMap(ev => interval(1000).pipe(take(5))) ); result.subscribe(x => console.log(x));
exhaustMap(project: (value: T, index: number) => O): OperatorFunction<T, ObservedValueOf<O>>
project | Type: |
OperatorFunction<T, ObservedValueOf<O>>
exhaustMap(project: (value: T, index: number) => O, resultSelector: undefined): OperatorFunction<T, ObservedValueOf<O>>
project | Type: |
resultSelector | Type: |
OperatorFunction<T, ObservedValueOf<O>>
exhaustMap(project: (value: T, index: number) => ObservableInput<I>, resultSelector: (outerValue: T, innerValue: I, outerIndex: number, innerIndex: number) => R): OperatorFunction<T, R>
project | Type: |
resultSelector | Type: |
OperatorFunction<T, R>
© 2015–2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors.
Code licensed under an Apache-2.0 License. Documentation licensed under CC BY 4.0.
https://rxjs.dev/api/operators/exhaustMap