MCPcopy
hub / github.com/triggerdotdev/trigger.dev / useCursorPath

Function useCursorPath

apps/webapp/app/components/ListPagination.tsx:64–75  ·  view source on GitHub ↗
(cursor: string | undefined, direction: Direction)

Source from the content-addressed store, hash-verified

62}
63
64function useCursorPath(cursor: string | undefined, direction: Direction) {
65 const location = useLocation();
66
67 if (!cursor) {
68 return undefined;
69 }
70
71 const search = new URLSearchParams(location.search);
72 search.set("cursor", cursor);
73 search.set("direction", direction);
74 return location.pathname + "?" + search.toString();
75}

Callers 2

NextButtonFunction · 0.85
PreviousButtonFunction · 0.85

Calls 2

toStringMethod · 0.80
setMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…