NextJSNetflix/hooks/useBillboard.ts

17 lines
371 B
TypeScript
Raw Permalink Normal View History

2023-08-18 12:00:58 +00:00
import useSWR from "swr";
import fetcher from "@/lib/fetcher";
const useBillBoard = () => {
const { data,error,isLoading } = useSWR('/api/random',fetcher,{
revalidateIfStale: false,
revalidateOnFocus: false,
revalidateOnReconnect: false
});
return {
data,
error,
isLoading
}
}
export default useBillBoard;