MCPcopy Create free account
hub / github.com/ChurchApps/B1Admin / handleSort

Function handleSort

src/hooks/useSortableData.ts:25–28  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

23 const [sortDirection, setSortDirection] = useState<SortDirection>(initialDirection);
24
25 const handleSort = (key: string) => {
26 setSortDirection(sortBy === key && sortDirection === "asc" ? "desc" : "asc");
27 setSortBy(key);
28 };
29
30 const sorted = useMemo(() => {
31 if (!sortBy) return data;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected