# StateThe Fetch API .
The useFetch
function exposes the following reactive state:
Boolean
If the request resulted in a non 200 status code. headers Record<string, string>
The response headers. isLoading Boolean
If the request is pending. response any
The response body as JSON or the raw response body as a string (depending on the content-type). status number
The HTTP status code. statusText number
The HTTP status text, eg: "OK" for 200. success Boolean
If the request is successful. i.e resulted in 200 status code. type string
Response type . # Methods
The useFetch
function exposes the following methods:
cancel
Cancels the fetch request if browser supports AbortController
, otherwise the request will complete but will not update the state. # Example
TODO: useFetch example
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4