mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2026-05-05 06:05:12 -04:00
* Add new error type for 429; remove unnecessary logs * Batch API calls for SpeciesSeenCheckmark * Remove SpeciesSeenCheckmark test * Revert logging errors * Use Set for observedTaxonIds * Add comments around logger.info statements * Merge linting update * More fixes from code review * Switch to non-authenticated useQuery for fetching taxon ids seen by X user id * Fix tests
19 lines
571 B
TypeScript
19 lines
571 B
TypeScript
import { useQuery } from "@tanstack/react-query";
|
|
import { reactQueryRetry } from "sharedHelpers/logging";
|
|
|
|
// Should work like React Query's useQuery with our custom reactQueryRetry
|
|
const useNonAuthenticatedQuery = (
|
|
queryKey: Array<string>,
|
|
queryFunction: Function,
|
|
queryOptions: Object = {}
|
|
): Object => useQuery( {
|
|
queryKey: [...queryKey, queryOptions.allowAnonymousJWT],
|
|
queryFn: queryFunction,
|
|
retry: ( failureCount, error ) => reactQueryRetry( failureCount, error, {
|
|
queryKey
|
|
} ),
|
|
...queryOptions
|
|
} );
|
|
|
|
export default useNonAuthenticatedQuery;
|