Associates a custom controller with the request.
Useful when you need to use your own AbortController, otherwise wretch will create a new controller itself.
const controller = new AbortController()// Associates the same controller with multiple requestswretch("url1") .addon(AbortAddon()) .signal(controller) .get() .json()wretch("url2") .addon(AbortAddon()) .signal(controller) .get() .json()// Aborts both requestscontroller.abort() Copy
const controller = new AbortController()// Associates the same controller with multiple requestswretch("url1") .addon(AbortAddon()) .signal(controller) .get() .json()wretch("url2") .addon(AbortAddon()) .signal(controller) .get() .json()// Aborts both requestscontroller.abort()
An instance of AbortController
Generated using TypeDoc
Associates a custom controller with the request.
Useful when you need to use your own AbortController, otherwise wretch will create a new controller itself.