Skip to content

@epikodelabs/streamix


@epikodelabs/streamix / aggregates/src/public-api / none

Function: none()

none<T>(predicate): Operator<T, boolean>

Defined in: projects/libraries/streamix/aggregates/src/lib/operators/none.ts:18

Creates a stream operator that tests if no values from the source stream satisfy a predicate.

This operator consumes the stream and applies the provided predicate to each value.

  • If the predicate returns truthy for any element, the operator immediately emits false and completes, short-circuiting the evaluation.
  • If the source completes without the predicate ever returning truthy, the operator emits true.

It mirrors Array.prototype.every with the predicate inverted and emits a single boolean value. Empty streams also emit true.

Type Parameters

T

T = any

The type of the values in the source stream.

Parameters

predicate

(value, index) => MaybePromise<boolean>

Function to test each value. It receives the value and its index, and it can be synchronous or async.

Returns

Operator<T, boolean>

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

Released under the GNU AGPL v3 or later.