UNPKG

react-fetch-hook

Version:
20 lines (17 loc) 443 B
// @flow type TUseFetchResult<T> = { data: ?T, isLoading: boolean, error?: Error & { status: number, statusText: string } }; declare function useFetch<T>(path: RequestInfo, options?: { ...RequestOptions, formatter?: (Response) => Promise<T>, depends?: Array<mixed>, }, specialOptions?: { formatter?: (Response) => Promise<T>, depends?: Array<mixed> }): TUseFetchResult<T>; declare export default typeof useFetch;