(direction: Exclude<SortDirection, 'NONE'>)
| 18 | // Transition the given sort direction to the next direction |
| 19 | // Note: we can only cycle between ASC <-> DESC, NONE is not supported |
| 20 | export function transition(direction: Exclude<SortDirection, 'NONE'>): Exclude<SortDirection, 'NONE'> { |
| 21 | if (direction === SortDirection.ASC) { |
| 22 | return SortDirection.DESC |
| 23 | } |
| 24 | return SortDirection.ASC |
| 25 | } |
| 26 | |
| 27 | // ---------------------------------------------------------------------------- |
| 28 | // Sort strategies |