Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function usePaginatedRequestQuery(key, request) {
return usePaginatedQuery(
[key, request.endpoint, request.query],
handleFetch,
camelizeKeys(request.options)
)
}
export function useBetterPaginatedQuery(
key: false | any[],
fetchFunction: (...params: any) => any,
config?: any
): PaginatedQueryResult {
return usePaginatedQuery(
key,
(_, ...params) => {
return fetchFunction(...params);
},
config
);
}
export function usePaginatedRequestQuery(
key: QueryKey,
request: PaginatedRequest,
isMountedRef: React.MutableRefObject
): PaginatedQueryResult {
return usePaginatedQuery(
key,
() => {
return handleFetch(request, isMountedRef)
},
{
refetchOnWindowFocus: false,
staleTime: 1000 * 30,
...camelizeKeys(request.options),
}
)
}