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

Function sortBy

packages/react/src/DataTable/useTable.ts:108–116  ·  view source on GitHub ↗

* Sort the input row data by the given header

(header: Header<Data>)

Source from the content-addressed store, hash-verified

106 * Sort the input row data by the given header
107 */
108 function sortBy(header: Header<Data>) {
109 const sortState = {
110 id: header.id,
111 direction:
112 sortByColumn && sortByColumn.id === header.id ? transition(sortByColumn.direction) : DEFAULT_SORT_DIRECTION,
113 }
114 setSortByColumn(sortState)
115 sortRows(sortState)
116 }
117
118 /**
119 * Sort the rows of a table with the given column sort state. If the data in the table is sparse,

Callers

nothing calls this directly

Calls 2

transitionFunction · 0.90
sortRowsFunction · 0.85

Tested by

no test coverage detected