I am trying to create a countdown timer using Observables, the examples http://reactivex.io/documentation/operators/timer.html do not seem to work. In this specific example, the timerInterval-related error is not an Observable function returned from the timer.
I also experimented with other approaches, and the best I came up with is:
Observable.interval(1000).take(10).subscribe(x => console.log(x));
The problem here is that it counts from 0 to 10, and I want a countdown timer, for example. 10.9.8 ... 0.
I also tried this, but timer does not exist for type Observable
Observable.range(10, 0).timer(1000).subscribe(x => console.log(x));
And also, which does not produce any conclusion.
Observable.range(10, 0).debounceTime(1000).subscribe(x => console.log(x));
To clarify, I need help implementing ReactiveX RxJS, not the MircoSoft version.
reactive-programming observable rxjs
Jonathan miles
source share