:
this.timerThree undefined latestValues[0] === 3, - this " ".
, this window, window.
timerThree const, , , ( , .
, , , , :
const timerOne = Rx.Observable.timer(1000, 4000);
const timerTwo = Rx.Observable.timer(2000, 4000)
let timerThree = Rx.Observable.timer(3000, 4000)
let combined = Rx.Observable
.combineLatest(
timerOne,
timerTwo,
timerThree
);
const subscribe = combined.subscribe(latestValues => {
const [timerValOne, timerValTwo, timerValThree] = latestValues;
if(latestValues[0] === 3) {
console.log("this ===>", this);
console.log("this.timerThree ===> ", this.timerThree);
subscribe.unsubscribe();
combined = Rx.Observable.combineLatest(timerOne, timerTwo, Rx.Observable.of(true));
combined.subscribe(lvs => {
const [tv1, tv2, tv3] = lvs
console.log(
`Timer One Latest: ${tv1},
Timer Two Latest: ${tv2},
Timer Three Latest: ${tv3}`
);
})
}
console.log(
`Timer One Latest: ${timerValOne},
Timer Two Latest: ${timerValTwo},
Timer Three Latest: ${timerValThree}`
);
});
unsubscribe(), , combineLatest Observable true.
timerThree const let, .
Fiddle