Promise.all behavior with RxJS Observables?

后端 未结 4 1904
暖寄归人
暖寄归人 2020-11-27 17:12

In Angular 1.x I would sometimes need to make multiple http requests and do something with all the responses. I would throw all the promises in an array and cal

4条回答
  •  独厮守ぢ
    2020-11-27 17:15

    forkJoin works fine too, but I'd prefer combineLatest since you don't need to worry about it taking the last value of observables. This way, you can just get updated whenever any of them emit a new value too (e.g. you fetch on an interval or something).

提交回复
热议问题