Files
GMW/services/frontend/src/hooks/use-config.ts
T

14 lines
303 B
TypeScript
Raw Normal View History

import useSWR from "swr";
import { configApi } from "@/lib/api";
import type { AppConfig } from "@/lib/types";
/**
* Fetch the app configuration from the backend.
*/
export function useConfig() {
return useSWR<AppConfig>(["config"], () => configApi.get(), {
dedupingInterval: 120_000,
});
}