MCPcopy Index your code
hub / github.com/primer/react / transition

Function transition

packages/react/src/DataTable/sorting.ts:20–25  ·  view source on GitHub ↗
(direction: Exclude<SortDirection, 'NONE'>)

Source from the content-addressed store, hash-verified

18// Transition the given sort direction to the next direction
19// Note: we can only cycle between ASC <-> DESC, NONE is not supported
20export 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

Callers 1

sortByFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected