Here's the working code sample:
from(this.files)
.pipe(
concatMap((item) =>
this.http.get(item.upper, {
responseType: "blob" as "json",
}),
)
)
.subscribe({
next: (res) => {
console.log(res);
},
complete() {
console.log("it has completed");
},
});
and I want to add another request and wait for both of them to complete to fire the next one like so
from(this.files)
.pipe(
mergeThemFunction({
concatMap((item) =>
upper: this.http.get(item.upper, {
responseType: "blob" as "json",
}),
concatMap((item) =>
lower:this.http.get(item.lower, {
responseType: "blob" as "json",
}),
}
)
)
.subscribe({
next: (res) => {
console.log(res);
},
complete() {
console.log("it has completed");
},
});
What rxjs method is most suitable for this, the documentation doesn't say much