timestamp.js 779 B

12345678910111213141516171819202122232425
  1. "use strict";
  2. var async_1 = require('../scheduler/async');
  3. var map_1 = require('./map');
  4. /**
  5. * @param scheduler
  6. * @return {Observable<Timestamp<any>>|WebSocketSubject<T>|Observable<T>}
  7. * @method timestamp
  8. * @owner Observable
  9. */
  10. function timestamp(scheduler) {
  11. if (scheduler === void 0) { scheduler = async_1.async; }
  12. return map_1.map(function (value) { return new Timestamp(value, scheduler.now()); });
  13. // return (source: Observable<T>) => source.lift(new TimestampOperator(scheduler));
  14. }
  15. exports.timestamp = timestamp;
  16. var Timestamp = (function () {
  17. function Timestamp(value, timestamp) {
  18. this.value = value;
  19. this.timestamp = timestamp;
  20. }
  21. return Timestamp;
  22. }());
  23. exports.Timestamp = Timestamp;
  24. ;
  25. //# sourceMappingURL=timestamp.js.map