In previous article we have seen RxJS concatMap Applying Observable concatenation to a series of HTTP operations seems like a good way to ensure that the HTTP oparation happen in the intended order.

However, in some situations, we want to run things in parallel, that is why we've got the Strategy merge Observable!

So Unlike concat, Merge will not wait until the Observable finishes until the next Observable is subscribed.

What is MergeMap Operator - RXJS

MergeMap is an flatting operator

Map + mergeAll = mergeMap

const source = from(["Tech", "Comedy", "News"]);

source.pipe(mergeMap((res) => this.getData(res))).subscribe((res) => {
      console.log(res);

    });

 getData(data) {
    return of(data + " Video Uploaded");
  }

Will output:

Tech Video Uploaded
merge-map.component.ts:36 Comedy Video Uploaded
merge-map.component.ts:36 News Video Uploaded

Topics covered:

Found this article helpful?

TutsCoder tutorials are free and ad-light — supported by readers like you. Buy me a coffee (or two ☕☕) as a token of appreciation and help keep Angular & Node.js content coming!

One-time. No subscription. 100% optional. 🙏 Every coffee counts!

Leave a Comment

Your email will not be published. Spam-free zone. ✌️

Available for Projects

Need Help With Your
Angular or Node.js Project?

7+ years of MEAN Stack experience. I build scalable Angular 21 apps, Node.js APIs, and SaaS products — delivered on time, every time.

7+ Years MEAN Stack Angular 21 + Nx Expert 20+ Projects Delivered Remote / Freelance