Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / sample

Function: sample()

sample<T>(period): Operator<T, T>

Defined in: projects/libraries/streamix/src/lib/operators/sample.ts:11

Creates a stream operator that emits the most recent value from the source stream at a fixed periodic interval.

Type Parameters

T

T = any

The type of the values in the source and output streams.

Parameters

period

MaybePromise<number>

The time in milliseconds between each emission.

Returns

Operator<T, T>

An Operator instance for use in a stream's pipe method.

Released under the MIT License.