How to 'wait' for two observables in RxJS

前端 未结 7 1542
温柔的废话
温柔的废话 2020-12-13 12:14

In my app i have something like:

this._personService.getName(id)
      .concat(this._documentService.getDocument())
      .subscribe((response) => {
              


        
7条回答
  •  北海茫月
    2020-12-13 12:24

    The RxJS Operators for Dummies: forkJoin, zip, combineLatest, withLatestFrom helped me a lot. As the name states it describes the following combination operators:

    • ForkJoin
    • zip
    • combineLatest
    • withLatestFrom

    Any of them could be the thing you are looking for, depends on the case. Check the article for more info.

提交回复
热议问题