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
| Parameter | Type | Description |
|---|---|---|
predicate | (value, index) => boolean | A 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
| Parameter | Type | Description |
|---|---|---|
predicate | BooleanConstructor | A 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>