Promise .all() with RxJS

后端 未结 4 2284
死守一世寂寞
死守一世寂寞 2020-12-06 01:14

I\'m writing an app in Angular 2 and I want to execute several http requests and run a function on the responses.

In Angular 1, I would write something like $q

4条回答
  •  青春惊慌失措
    2020-12-06 01:31

    I'm not sure you'd want to use forkJoin/zip, especially considering combineLatest is easier to understand and will emit on every sub-stream event, whereas forkJoin basically samples on every sub-stream having emitted.

    This might come to bite you later when you want to combine multi-item Observables down the road.

提交回复
热议问题