This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
import { asyncScheduler } from '../scheduler/async';
import { operate } from '../util/lift';
import { createOperatorSubscriber } from './OperatorSubscriber';
export function timeInterval(scheduler = asyncScheduler) {
return operate((source, subscriber) => {
let last = scheduler.now();
source.subscribe(createOperatorSubscriber(subscriber, (value) => {
const now = scheduler.now();
const interval = now - last;
last = now;
subscriber.next(new TimeInterval(value, interval));
}));
});
}
export class TimeInterval {
constructor(value, interval) {
this.value = value;
this.interval = interval;
}
}
//# sourceMappingURL=timeInterval.js.map