All files / app/features/donations useDonationStats.ts

80% Statements 4/5
100% Branches 0/0
0% Functions 0/1
80% Lines 4/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 152x 2x     2x   2x                
import { useQuery } from "@tanstack/react-query";
import { donationStatsKey } from "features/queryKeys";
import { RpcError } from "grpc-web";
import { GetDonationStatsRes } from "proto/public_pb";
import { service } from "service";
 
export default function useDonationStats() {
  return useQuery<GetDonationStatsRes.AsObject, RpcError>({
    queryKey: [donationStatsKey],
    queryFn: service.publicApi.getDonationStats,
    // Cache for 5 minutes
    staleTime: 5 * 60 * 1000,
  });
}