diff options
Diffstat (limited to 'node_modules/rxjs/dist/esm/internal/operators/timeInterval.js')
| -rw-r--r-- | node_modules/rxjs/dist/esm/internal/operators/timeInterval.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/node_modules/rxjs/dist/esm/internal/operators/timeInterval.js b/node_modules/rxjs/dist/esm/internal/operators/timeInterval.js new file mode 100644 index 0000000..3f93bf7 --- /dev/null +++ b/node_modules/rxjs/dist/esm/internal/operators/timeInterval.js @@ -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
\ No newline at end of file |
