【发布时间】:2020-11-07 16:37:03
【问题描述】:
我这里有这个逻辑,它创建了许多 observable 并在每个完成后执行回调。
from(rows).pipe(
concatMap(row => this.uploadItem(row))
).subscribe(response => {
this.currentRowNode.data.uploadStatus = UploadStatus.Success;
this.currentRowNode.data.cmsRowId = response.responsePayload.cmsRowId
this.currentRowNode.setData(this.currentRowNode.data);
});
currentRowNode: RowNode;
uploadItem(rowNode: RowNode): Observable<any> {
this.currentRowNode = rowNode;
rowNode.data.uploadStatus = UploadStatus.Uploading;
rowNode.updateData(rowNode.data);
return this.importService.uploadItem(rowNode.data)
}
我的问题是,我希望能够订阅一些内容,告诉我 uploadItem 已被每个 rows 调用
那会去哪里?
【问题讨论】:
标签: angular angular9 angular10 rxjs-observables