BACK
ReferencebufferTime
Reference · 42

bufferTime

bufferTime

rxjs.dev

Collects values into arrays by a time window.

Signature

bufferTime(bufferTimeSpan: number): OperatorFunction

Marble diagram

a-b-c-| + bufferTime  →  [a,b,c]

What it does

Opens a buffer for bufferTimeSpan milliseconds and emits the array of collected values. If the source completes earlier, the current buffer is sent right away.

When to use

Batched telemetry, accumulating logs, collecting frequent UI events into compact batches.

See also

buffer, bufferCount, windowTime

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