MergeMap
Projects each source value to an Observable which is merged in the output Observable.
Last updated
Was this helpful?
Projects each source value to an Observable which is merged in the output Observable.
Last updated
Was this helpful?
Parameters
project
A function that, when applied to an item emitted by the source Observable, returns an Observable.
resultSelector
Optional. Default is undefined
.
Type: number | ((outerValue: T, innerValue: ObservedValueOf, outerIndex: number, innerIndex: number) => R)
.
concurrent
Optional. Default is Number.POSITIVE_INFINITY
.
Maximum number of input Observables being subscribed to concurrently.
Projects each source value to an Observable which is merged in the output Observable. Maps each value to an Observable, then flattens all of these inner Observables using mergeAll.
The main difference between mergeMap
and concatMap
is that concatMap
wait until the previous observable ends to start executing the next the mergeMap
does not do that as you can see in the previous image.