combinelatest

what triggered combineLatest?

不羁的心 提交于 2019-12-18 13:33:15
问题 I have a few observables. And I need to know which one triggered the subscribe. Observable.combineLatest( this.tournamentsService.getUpcoming(), this.favoriteService.getFavoriteTournaments(), this.teamsService.getTeamRanking(), (tournament, favorite, team) => { //what triggered combinelatest to run? }).subscribe() 回答1: Short answer is: You don't know. You could implement some workaround, however this is really ugly and I would recommend rethinking the usecase why you need this and maybe if

combineLatest behaviour in Rxjs 5?

為{幸葍}努か 提交于 2019-12-11 03:52:02
问题 Looking at the definition of combineLatest Combines multiple Observables to create an Observable whose values are calculated from the latest values of each of its input Observables. or Whenever any input Observable emits a value, it computes a formula using the latest values from all the inputs, then emits the output of that formula. It's pretty clear to see that at each period of time / emission , the result at that emission is the combination of the latest emissions. If so , looking at this