This is RxJS v 4. Find the latest version here
Returns an observable sequence that produces a value after each period.
period
(Number
): Period for producing the values in the resulting sequence (specified as an integer denoting milliseconds).[scheduler]
(Scheduler=Rx.Scheduler.timeout): Scheduler to run the timer on. If not specified, Rx.Scheduler.timeout is used.
(Observable
): An observable sequence that produces a value after each period. Each value produced will default to a Number
denoting its order in the timeline. (e.g. 0, 1, 2...
)
var source = Rx.Observable
.interval(500 /* ms */)
.timeInterval()
.take(3);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: {value: 0, interval: 500}
// => Next: {value: 1, interval: 500}
// => Next: {value: 2, interval: 500}
// => Completed
File:
Dist:
Prerequisites:
- if
rx.time.js
rx.lite.js
|rx.lite.compat.js
NPM Packages:
NuGet Packages:
Unit Tests: