How to use the react-query.usePaginatedQuery function in react-query

To help you get started, we’ve selected a few react-query examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github exercism / website / app / javascript / hooks / request-query.js View on Github external
export function usePaginatedRequestQuery(key, request) {
  return usePaginatedQuery(
    [key, request.endpoint, request.query],
    handleFetch,
    camelizeKeys(request.options)
  )
}
github Mines-Paristech-Students / Portail-des-eleves / frontend / src / services / apiService.ts View on Github external
export function useBetterPaginatedQuery(
  key: false | any[],
  fetchFunction: (...params: any) => any,
  config?: any
): PaginatedQueryResult {
  return usePaginatedQuery(
    key,
    (_, ...params) => {
      return fetchFunction(...params);
    },
    config
  );
}
github exercism / website / app / javascript / hooks / request-query.ts View on Github external
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),
    }
  )
}