Catches an AbortError and performs a callback.
Aborts the request after a fixed time.
If you use a custom AbortController associated with the request, pass it in the options object.
// 1 second timeout
wretch("...").addon(AbortAddon()).get().setTimeout(1000).json(_ =>
// will not be called if the request timeouts
)
// With custom controller
wretch("...").addon(AbortAddon()).get().setTimeout(1000, { controller }).json()
Time in milliseconds
Optionaloptions: SetTimeoutOptionsOptional configuration object
Returns the provided or generated AbortController plus the wretch response chain as a pair.