'How do I call 2 API in parallel and the third right after that in RXJS?

I want to make 2 API calls in Parallel and then the third immediately after that. I am able to run API calls in Parallel using merge map and consecutively using concatMap. I want to combine the two.

//Call API1 and API2 in Parallel
// from([apiCall(1), apiCall(2)]).pipe(
//   mergeMap(e=>e)
// ).subscribe(x => console.log(x));

//Call API1 and API2 consecutively
// from([apiCall(1), apiCall(2)]).pipe(
//   concatMap(e=>e)
// ).subscribe(x => console.log(x));

//Call API1 and API2 in Parallel and API 3 right after both finishes
from([apiCall(1), apiCall(2), apiCall(3)]).pipe(
  // ????
).subscribe(x => console.log(x));

How can I do such?

Stackblitz playground here => https://stackblitz.com/edit/playground-rxjs-263xwk



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source