我有一组 ID。例如:[1,2,3,4]。
我想进行并行调用并获得forkJoin
数组每个元素的结果。但是下面的代码对我不起作用。
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);
});
谁能帮助我如何实现这一目标?谢谢