TinyBase logoTinyBase β

Sorter

The Sorter type represents a function that compares two SortKey values.

(
  sortKey1: SortKey,
  sortKey2: SortKey,
): number
TypeDescription
sortKey1SortKey

The first item of the pair to compare.

sortKey2SortKey

The second item of the pair to compare.

returnsnumber

A number indicating how to sort the pair.

A Sorter is provided to methods that sort Row Ids when the default alphanumeric ordering is not appropriate. Return a positive or negative number to indicate which of the two SortKey values should be ordered first.

Since

v9.1.0