I have an array of IDs. For eg: [1,2,3,4].
I would like to make parallel calls and get the result with forkJoin
for each element of the array. But below code is not working for me.
forkJoin(
Array.from(this.question.attachments).map(attachment => {
return mergeMap((attachment) => ) // i am stuck here.
})
)
.pipe(
takeUntil(this.destroy$),
finalize(() => this.spinnerService.hide())
)
.subscribe((attachmentIds) => {
this.uploadedAttachments = attachmentIds;
this.onFilesAttached.emit(this.uploadedAttachments);
});
Can anyone help me how to achieve this? Thanks