source: trip-planner-front/node_modules/rxjs/_esm5/internal/operators/timeInterval.js

Last change on this file 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/** PURE_IMPORTS_START _scheduler_async,_scan,_observable_defer,_map PURE_IMPORTS_END */
2import { async } from '../scheduler/async';
3import { scan } from './scan';
4import { defer } from '../observable/defer';
5import { map } from './map';
6export function timeInterval(scheduler) {
7 if (scheduler === void 0) {
8 scheduler = async;
9 }
10 return function (source) {
11 return defer(function () {
12 return source.pipe(scan(function (_a, value) {
13 var current = _a.current;
14 return ({ value: value, current: scheduler.now(), last: current });
15 }, { current: scheduler.now(), value: undefined, last: undefined }), map(function (_a) {
16 var current = _a.current, last = _a.last, value = _a.value;
17 return new TimeInterval(value, current - last);
18 }));
19 });
20 };
21}
22var TimeInterval = /*@__PURE__*/ (function () {
23 function TimeInterval(value, interval) {
24 this.value = value;
25 this.interval = interval;
26 }
27 return TimeInterval;
28}());
29export { TimeInterval };
30//# sourceMappingURL=timeInterval.js.map
Note: See TracBrowser for help on using the repository browser.