This is RxJS v 4. Find the latest version here
Records the timestamp for each value in an observable sequence.
[scheduler=Rx.Observable.timeout]
(Scheduler
): Scheduler used to compute timestamps. If not specified, the timeout scheduler is used.
(Observable
): An observable sequence with timestamp information on values.
var source = Rx.Observable.timer(0, 1000)
.timestamp()
.map(function (x) { return x.value + ':' + x.timestamp; })
.take(5);
var subscription = source.subscribe(
function (x) {
console.log('Next: ' + x);
},
function (err) {
console.log('Error: ' + err);
},
function () {
console.log('Completed');
});
// => Next: 0:1378690776351
// => Next: 1:1378690777313
// => Next: 2:1378690778316
// => Next: 3:1378690779317
// => Next: 4:1378690780319
// => Completed
File:
Dist:
Prerequisites:
NPM Packages:
NuGet Packages:
Unit Tests: