mergeMap(project: function: Observable, resultSelector: function: any, concurrent: number): Observable
switchMapeach inner subscription is completed when the source emits, allowing only one active inner subscription. In contrast,
mergeMapallows for multiple inner subscriptions to be active at a time. Because of this, one of the most common use-case for
mergeMapis requests that should not be canceled, think writes rather than reads. Note that if order must be maintained
concatMapis a better option.
mergeMapmaintains multiple active inner subscriptions at once it's possible to create a memory leak through long-lived inner subscriptions. A basic example would be if you were mapping to an observable with an inner timer, or a stream of dom events. In these cases, if you still wish to utilize
mergeMapyou may want to take advantage of another operator to manage the completion of the inner subscription, think
takeUntil. You can also limit the number of active inner subscriptions at a time with the
concurrentparameter, seen in example 5.