aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/rxjs/src/internal/operators/timeInterval.ts
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
committerPinapelz <yukais@pinapelz.com>2025-06-29 11:49:28 -0700
commitd55b767039605256c736166a942a9138e3eacfd7 (patch)
tree947063b634c50d438a794325f13275e134aa5993 /node_modules/rxjs/src/internal/operators/timeInterval.ts
parent864ce67d89c77d8ef9c3361f80d619853abcf91c (diff)
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/rxjs/src/internal/operators/timeInterval.ts')
-rw-r--r--node_modules/rxjs/src/internal/operators/timeInterval.ts67
1 files changed, 0 insertions, 67 deletions
diff --git a/node_modules/rxjs/src/internal/operators/timeInterval.ts b/node_modules/rxjs/src/internal/operators/timeInterval.ts
deleted file mode 100644
index 6a58ab2..0000000
--- a/node_modules/rxjs/src/internal/operators/timeInterval.ts
+++ /dev/null
@@ -1,67 +0,0 @@
-import { asyncScheduler } from '../scheduler/async';
-import { SchedulerLike, OperatorFunction } from '../types';
-import { operate } from '../util/lift';
-import { createOperatorSubscriber } from './OperatorSubscriber';
-
-/**
- * Emits an object containing the current value, and the time that has
- * passed between emitting the current value and the previous value, which is
- * calculated by using the provided `scheduler`'s `now()` method to retrieve
- * the current time at each emission, then calculating the difference. The `scheduler`
- * defaults to {@link asyncScheduler}, so by default, the `interval` will be in
- * milliseconds.
- *
- * <span class="informal">Convert an Observable that emits items into one that
- * emits indications of the amount of time elapsed between those emissions.</span>
- *
- * ![](timeInterval.png)
- *
- * ## Example
- *
- * Emit interval between current value with the last value
- *
- * ```ts
- * import { interval, timeInterval } from 'rxjs';
- *
- * const seconds = interval(1000);
- *
- * seconds
- * .pipe(timeInterval())
- * .subscribe(value => console.log(value));
- *
- * // NOTE: The values will never be this precise,
- * // intervals created with `interval` or `setInterval`
- * // are non-deterministic.
- *
- * // { value: 0, interval: 1000 }
- * // { value: 1, interval: 1000 }
- * // { value: 2, interval: 1000 }
- * ```
- *
- * @param scheduler Scheduler used to get the current time.
- * @return A function that returns an Observable that emits information about
- * value and interval.
- */
-export function timeInterval<T>(scheduler: SchedulerLike = asyncScheduler): OperatorFunction<T, TimeInterval<T>> {
- 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));
- })
- );
- });
-}
-
-// TODO(benlesh): make this an interface, export the interface, but not the implemented class,
-// there's no reason users should be manually creating this type.
-
-export class TimeInterval<T> {
- /**
- * @deprecated Internal implementation detail, do not construct directly. Will be made an interface in v8.
- */
- constructor(public value: T, public interval: number) {}
-}
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage