MCPcopy Index your code
hub / github.com/OpenPipe/OpenPipe / usePageParams

Function usePageParams

app/src/utils/hooks.ts:88–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

86export const useIsMissingBetaAccess = () => !useActiveFeatureFlags()?.includes("betaAccess");
87
88export const usePageParams = () => {
89 const router = useRouter();
90
91 const page = parseInt(router.query.page as string, 10) || 1;
92 const pageSize = parseInt(router.query.pageSize as string, 10) || 10;
93
94 const setPageParams = (newPageParams: { page?: number; pageSize?: number }) => {
95 const updatedQuery = {
96 ...router.query,
97 ...newPageParams,
98 };
99
100 void router.push(
101 {
102 pathname: router.pathname,
103 query: updatedQuery as Query,
104 },
105 undefined,
106 { shallow: true },
107 );
108 };
109
110 return { page, pageSize, setPageParams };
111};
112
113export const useSearchQuery = () => {
114 const router = useRouter();

Callers 6

PaginatorFunction · 0.90
useNodeEntriesFunction · 0.85
useTrainingEntriesFunction · 0.85
useTestingEntriesFunction · 0.85
useLoggedCallsFunction · 0.85
useAdminProjectsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected