BACK
ReferenceauditTime
Reference · 40

auditTime

auditTime

rxjs.dev

Audit with a fixed window duration.

Signature

auditTime(duration: number): MonoTypeOperatorFunction

Marble diagram

a-b-c----| + auditTime(0)  →  ----c|

What it does

Opens a time window after a value, ignores new values inside it, and emits the last one at the end. Unlike debounceTime, the window is not extended by each new value.

When to use

UI events where you want to cap the update rate but keep the window's last state: scroll position, sizes, mouse coordinates.

See also

audit, debounceTime, throttleTime

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