Type alias Sorter<Item>

Sorter<Item>: Unary<Item, Unary<Item, number>>

Curried sorter Unary function.

Remarks

Type to represent a function that takes two items and returns a number to determine their order. If the result is negative, the first item is sorted before the second item. If the result is positive, the first item is sorted after the second item. If the result is zero, the order of the items is unchanged.

Example

const sorter: Sorter<number> = value1 => value2 => value1 - value2;

See

Type Parameters

  • Item

    Type of the items to sort.