source: trip-planner-front/node_modules/rxjs/_esm2015/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: 672 bytes
Line 
1import { async } from '../scheduler/async';
2import { scan } from './scan';
3import { defer } from '../observable/defer';
4import { map } from './map';
5export function timeInterval(scheduler = async) {
6 return (source) => defer(() => {
7 return source.pipe(scan(({ current }, value) => ({ value, current: scheduler.now(), last: current }), { current: scheduler.now(), value: undefined, last: undefined }), map(({ current, last, value }) => new TimeInterval(value, current - last)));
8 });
9}
10export class TimeInterval {
11 constructor(value, interval) {
12 this.value = value;
13 this.interval = interval;
14 }
15}
16//# sourceMappingURL=timeInterval.js.map
Note: See TracBrowser for help on using the repository browser.