Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/netzo/deps/usehooks-ts.ts>useFetch

Full-stack Deno framework for building business web apps like internal tools, dashboards, admin panels and automated workflows.
Go to Latest
function useFetch
Deprecated
Deprecated
  • useFetch is deprecated and will be removed in the next major version. See the documentation for more information. Custom hook for making HTTP requests and managing the state of the request.
import { useFetch } from "https://deno.land/x/netzo@0.5.70/deps/usehooks-ts.ts";

Examples

const { data, error } = useFetch('https://api.example.com/user');

Type Parameters

optional
T = unknown
  • The type of data expected in the response.

Parameters

optional
url: string
  • The URL to make the HTTP request to.
optional
options: RequestInit

Returns

State<T>

The state object representing the result of the HTTP request.