feat: build production-ready wtr weather PWA
This commit is contained in:
15
hooks/use-hydro.ts
Normal file
15
hooks/use-hydro.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
"use client";
|
||||
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { fetchHydroStations } from "@/lib/imgw-api";
|
||||
import { QUERY_GC_TIME, QUERY_STALE_TIME } from "@/lib/constants";
|
||||
|
||||
export function useHydroStations() {
|
||||
return useQuery({
|
||||
queryKey: ["hydro-stations"],
|
||||
queryFn: ({ signal }) => fetchHydroStations(signal),
|
||||
staleTime: QUERY_STALE_TIME,
|
||||
gcTime: QUERY_GC_TIME,
|
||||
retry: 2,
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user