BACK
ReferencesampleTime
Reference · 97

sampleTime

sampleTime

rxjs.dev

Takes the latest value at regular time intervals.

Signature

sampleTime(period: number): MonoTypeOperatorFunction

What it does

Every period milliseconds it checks whether source had a new value and, if so, emits the latest one.

When to use

Regularly sampling the state of a noisy stream: scroll, mousemove, progress, sensors.

See also

sample, auditTime, throttleTime

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...