所以,我有一个服务,它有三个我需要执行的功能.
我使用forkJoin
是因为我想在收到所有人的回复后采取进一步行动!
getDevices(id: string): Observable<IEquipmentRow[]> {
const url = `${apiUrl}/${id}`;
return this.http.get<IGetDevicesResponse>(url)
.pipe(
map(res => {
return res.data;
})
);
}
private regions$ = this.getRegions();
private devices$ = this.getDevices();
public equipmentPreparationData$ = forkJoin({
regions: this.regions$,
devices: this.devices$
});
实现这一点的最佳方式是什么?可能使用RxJS
Subject
/BehaviorSubject
?