Seenuvasan Velayutham
Seenuvasan Velayutham

Reputation: 39

How to reset combinelatest after subscribe

My requirement in rxJs is, how to reset combinelatest after subscribing the data.

after subscribing the result, the subscription again need to call only all the observable get modified (all the combinelatest parameter). and not for any one of the parameter modified.

Observable.combineLatest(
      this.one$,
      this.two$,
      this.three$,
      this.four$,
      this.five$
    ).subscribe(data => {
      console.log(data);
    },
    err => console.error(err));

Upvotes: 1

Views: 679

Answers (1)

Uncle_Jerry
Uncle_Jerry

Reputation: 104

I think you need the zip operator.

zip(
  this.one$,
  this.two$,
  this.three$,
  this.four$,
  this.five$
).subscribe(data => {
  console.log(data);
},
err => console.error(err));

Upvotes: 4

Related Questions