This repository has been archived on 2024-07-27. You can view files and clone it, but cannot push or open issues or pull requests.
keksAccountGUI/node_modulesOLD/rxjs/_esm2015/internal/operators/timeInterval.js
2019-08-11 20:48:02 +02:00

16 lines
No EOL
672 B
JavaScript

import { async } from '../scheduler/async';
import { scan } from './scan';
import { defer } from '../observable/defer';
import { map } from './map';
export function timeInterval(scheduler = async) {
return (source) => defer(() => {
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)));
});
}
export class TimeInterval {
constructor(value, interval) {
this.value = value;
this.interval = interval;
}
}
//# sourceMappingURL=timeInterval.js.map