All Components

Comparer

A type representing a function that compares two values and returns 1, 0, or -1.

For more information, refer to the
composeSortDescriptors configuration.

const isGreaterThan: Comparer = (a, b) => a > b ? 1 : -1;
isGreaterThan(42, 42); // 0
isGreaterThan(22, 42); // -1
isGreaterThan(42, 22); // 1
In this article