Skip to content

Function: max()

max<T>(comparator?): Operator<T, T>

Defined in: operators/max.ts:13

Creates a stream operator that emits the maximum value from the source stream.

This is a terminal operator that consumes the entire source lazily, emitting phantoms along the way and finally emitting the maximum value.

Type Parameters

T

T = any

The type of the values in the source stream.

Parameters

comparator?

(a, b) => CallbackReturnType<number>

Optional comparison function: positive if a > b, negative if a < b.

Returns

Operator<T, T>

An Operator instance usable in a stream's pipe method.

Released under the MIT License.