Skip to content

Documentation / @eventkit/base / every

Function: every()

Call Signature

ts
function every<T>(predicate): SingletonOperatorFunction<T, boolean>

Determines whether all items emitted by the source observable satisfy a specified condition. Emits true if all values pass the condition, or false immediately if any value fails.

Note: If any value fails the predicate, the observable will be cancelled.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
predicate(value, index) => booleanA function that evaluates each value emitted by the source observable. Returns true if the value satisfies the condition, false otherwise.

Returns

SingletonOperatorFunction<T, boolean>

Call Signature

ts
function every<T>(predicate): SingletonOperatorFunction<T, Exclude<T, Falsy> extends never ? false : boolean>

Determines whether all items emitted by the source observable satisfy a specified condition. Emits true if all values pass the condition, or false immediately if any value fails.

Note: If any value fails the predicate, the observable will be cancelled.

Type Parameters

Type Parameter
T

Parameters

ParameterTypeDescription
predicateBooleanConstructorA function that evaluates each value emitted by the source observable. Returns true if the value satisfies the condition, false otherwise.

Returns

SingletonOperatorFunction<T, Exclude<T, Falsy> extends never ? false : boolean>

Released under the MIT License.