source: trip-planner-front/node_modules/rxjs/internal/operators/timeInterval.js@ 6a3a178

Last change on this file since 6a3a178 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.1 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var async_1 = require("../scheduler/async");
4var scan_1 = require("./scan");
5var defer_1 = require("../observable/defer");
6var map_1 = require("./map");
7function timeInterval(scheduler) {
8 if (scheduler === void 0) { scheduler = async_1.async; }
9 return function (source) { return defer_1.defer(function () {
10 return source.pipe(scan_1.scan(function (_a, value) {
11 var current = _a.current;
12 return ({ value: value, current: scheduler.now(), last: current });
13 }, { current: scheduler.now(), value: undefined, last: undefined }), map_1.map(function (_a) {
14 var current = _a.current, last = _a.last, value = _a.value;
15 return new TimeInterval(value, current - last);
16 }));
17 }); };
18}
19exports.timeInterval = timeInterval;
20var TimeInterval = (function () {
21 function TimeInterval(value, interval) {
22 this.value = value;
23 this.interval = interval;
24 }
25 return TimeInterval;
26}());
27exports.TimeInterval = TimeInterval;
28//# sourceMappingURL=timeInterval.js.map
Note: See TracBrowser for help on using the repository browser.