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 as the second argument.
// 1 second timeout
wretch("...").addon(AbortAddon()).get().setTimeout(1000).json(_ =>
// will not be called if the request timeouts
)
Time in milliseconds
Optional
controller: AbortControllerAn instance of AbortController
Returns the provided or generated AbortController plus the wretch response chain as a pair.