use-minimal-fetch
Version:
A lightweight useFetch hook with Axios wrapper for React apps
13 lines (12 loc) • 312 B
TypeScript
interface FetchOptions {
lazy?: boolean;
params?: Record<string, any>;
headers?: Record<string, string>;
}
export declare const useFetchHook: <T = any>(url: string, options?: FetchOptions) => {
data: T | null;
loading: boolean;
error: any;
refetch: () => Promise<void>;
};
export {};