import useSWR from "swr"; import { fetchAPI } from "./api"; export function usePoll(path: string, interval: number = 60000) { return useSWR(path, () => fetchAPI(path), { refreshInterval: interval, revalidateOnFocus: false, }); }