Search code examples
javascriptangulartypescriptrxjsreactivex

Worthiest way to wait until first observable complete to do the second subscribe logic?


I was wondering the best way to achieve this.

If i have two observables A & B, and i want to process the next B logic after the A has completed his next logic.

I'm currently using combineLatest for that purpose.

Any best choice?

Thanks!


Solution

  • I would use b$.pipe(withLatestFrom(a$)). This way you can see things clearly. But combineLatest works fine.