● Zion Boggan
repos/Drophawk/frontend/hooks/useStats.ts
zionboggan.com ↗
13 lines · typescript
History for this file →
1
"use client";
2
 
3
import { useQuery } from "@tanstack/react-query";
4
import { api } from "@/lib/api";
5
import { queryKeys } from "@/lib/query";
6
 
7
export function useStats() {
8
  return useQuery({
9
    queryKey: queryKeys.stats,
10
    queryFn: () => api.stats(),
11
    refetchInterval: 30_000,
12
  });
13
}