Angular 6 pipe RxJs operator to chain 3 dependant observables

前端 未结 3 1487
时光取名叫无心
时光取名叫无心 2020-12-28 09:53

I have 3 dependent Rest API resources (lets say observables) like this:

1st observable produces one item as array of users, like this:

getUsers(): Ob         


        
3条回答
  •  爱一瞬间的悲伤
    2020-12-28 10:20

    Here are the operators for combination, these emit the result in an array (reference):

    • combineAll
    • combineLatest
    • forkJoin
    • pairwise
    • zip (the solution I would suggest)

    I would suggest giving them all a read, to work out what you would prefer and find best for your scenario.

    Hope this helps!

提交回复
热议问题