API reference › @evolu/common › Types › Predicate
type Predicate<T> = (value: T) => boolean;
Defined in: packages/common/src/Types.ts:54
Checks a condition on a value and returns a boolean.
A predicate starts with an 'is' prefix, e.g., isEven.
Example
const isEven: Predicate<number> = (n) => n % 2 === 0;
const numbers = [1, 2, 3, 4];
const evenNumbers = numbers.filter(isEven); // [2, 4]