Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / src/public-api / audit

Function: audit() ​

audit<T>(duration): Operator<T, T>

Defined in: projects/libraries/streamix/src/lib/operators/audit.ts:16

Creates a stream operator that emits the latest value from the source stream at most once per specified duration.

Each incoming value is stored as the "latest"; a timer emits that latest value when the duration elapses. Values that arrive between timer ticks and are superseded before the timer fires are simply not emitted.

Type Parameters ​

T ​

T = any

The type of the values in the stream.

Parameters ​

duration ​

number

The time in milliseconds to wait before emitting the latest value.

Returns ​

Operator<T, T>

An Operator instance that can be used in a stream's pipe method.

Released under the MIT License.