Questions about mergeMap operator, an RxJS flattening operator to handle observables and emit values.
signature: mergeMap(project: function: Observable, resultSelector: function: any, concurrent: number): Observable
mergeMap
offers full control over asynchronicity - both when new elements are created/emitted and how many elements from the source stream should be processed concurrently. For example: assume a source stream emitted 10 elements but maxConcurrency
is set to 2 then two first elements will be processed immediately and the rest 8 buffered. Once one of the processed elements is completed, the next element from the source stream will be processed and so on.