source: trip-planner-front/node_modules/rxjs/internal/operators/sampleTime.d.ts@ ceaed42

Last change on this file since ceaed42 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.8 KB
Line 
1import { MonoTypeOperatorFunction, SchedulerLike } from '../types';
2/**
3 * Emits the most recently emitted value from the source Observable within
4 * periodic time intervals.
5 *
6 * <span class="informal">Samples the source Observable at periodic time
7 * intervals, emitting what it samples.</span>
8 *
9 * ![](sampleTime.png)
10 *
11 * `sampleTime` periodically looks at the source Observable and emits whichever
12 * value it has most recently emitted since the previous sampling, unless the
13 * source has not emitted anything since the previous sampling. The sampling
14 * happens periodically in time every `period` milliseconds (or the time unit
15 * defined by the optional `scheduler` argument). The sampling starts as soon as
16 * the output Observable is subscribed.
17 *
18 * ## Example
19 * Every second, emit the most recent click at most once
20 * ```ts
21 * import { fromEvent } from 'rxjs';
22 * import { sampleTime } from 'rxjs/operators';
23 *
24 * const clicks = fromEvent(document, 'click');
25 * const result = clicks.pipe(sampleTime(1000));
26 * result.subscribe(x => console.log(x));
27 * ```
28 *
29 * @see {@link auditTime}
30 * @see {@link debounceTime}
31 * @see {@link delay}
32 * @see {@link sample}
33 * @see {@link throttleTime}
34 *
35 * @param {number} period The sampling period expressed in milliseconds or the
36 * time unit determined internally by the optional `scheduler`.
37 * @param {SchedulerLike} [scheduler=async] The {@link SchedulerLike} to use for
38 * managing the timers that handle the sampling.
39 * @return {Observable<T>} An Observable that emits the results of sampling the
40 * values emitted by the source Observable at the specified time interval.
41 * @method sampleTime
42 * @owner Observable
43 */
44export declare function sampleTime<T>(period: number, scheduler?: SchedulerLike): MonoTypeOperatorFunction<T>;
Note: See TracBrowser for help on using the repository browser.