diff options
| author | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
|---|---|---|
| committer | Pinapelz <yukais@pinapelz.com> | 2025-06-29 11:49:28 -0700 |
| commit | d55b767039605256c736166a942a9138e3eacfd7 (patch) | |
| tree | 947063b634c50d438a794325f13275e134aa5993 /node_modules/rxjs/src/internal/operators/timestamp.ts | |
| parent | 864ce67d89c77d8ef9c3361f80d619853abcf91c (diff) | |
remove dev node_modules (oops)
Diffstat (limited to 'node_modules/rxjs/src/internal/operators/timestamp.ts')
| -rw-r--r-- | node_modules/rxjs/src/internal/operators/timestamp.ts | 39 |
1 files changed, 0 insertions, 39 deletions
diff --git a/node_modules/rxjs/src/internal/operators/timestamp.ts b/node_modules/rxjs/src/internal/operators/timestamp.ts deleted file mode 100644 index bb388de..0000000 --- a/node_modules/rxjs/src/internal/operators/timestamp.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { OperatorFunction, TimestampProvider, Timestamp } from '../types'; -import { dateTimestampProvider } from '../scheduler/dateTimestampProvider'; -import { map } from './map'; - -/** - * Attaches a timestamp to each item emitted by an observable indicating when it was emitted - * - * The `timestamp` operator maps the *source* observable stream to an object of type - * `{value: T, timestamp: R}`. The properties are generically typed. The `value` property contains the value - * and type of the *source* observable. The `timestamp` is generated by the schedulers `now` function. By - * default, it uses the `asyncScheduler` which simply returns `Date.now()` (milliseconds since 1970/01/01 - * 00:00:00:000) and therefore is of type `number`. - * - *  - * - * ## Example - * - * In this example there is a timestamp attached to the document's click events - * - * ```ts - * import { fromEvent, timestamp } from 'rxjs'; - * - * const clickWithTimestamp = fromEvent(document, 'click').pipe( - * timestamp() - * ); - * - * // Emits data of type { value: PointerEvent, timestamp: number } - * clickWithTimestamp.subscribe(data => { - * console.log(data); - * }); - * ``` - * - * @param timestampProvider An object with a `now()` method used to get the current timestamp. - * @return A function that returns an Observable that attaches a timestamp to - * each item emitted by the source Observable indicating when it was emitted. - */ -export function timestamp<T>(timestampProvider: TimestampProvider = dateTimestampProvider): OperatorFunction<T, Timestamp<T>> { - return map((value: T) => ({ value, timestamp: timestampProvider.now() })); -} |
