Provide AbortController implementation for load({ fetch })
#4866
Labels
feature request
New feature or request
Milestone
load({ fetch })
#4866
Describe the problem
The preferred way to set up timeouts with
fetch
is to useAbortController
. This is a browser API that does not exist in most supported node versions (or other environments) and requires a user provided polyfill to work correctly.abort-controller
is whatnode-fetch
suggests as a solution.The user has to handle both the browser and ssr rendering cases with something like:
This is awkward, and I think it's in the spirit of Svelte Kit to help out with this.
Describe the proposed solution
Expose a polyfilled
AbortController
implementation as a parameter like we did withfetch
, i.e.load({ fetch, AbortController })
, or as a global.Alternatives considered
Bring your own polyfill and set up logic yourself.
Importance
would make my life easier
Additional Information
No response
The text was updated successfully, but these errors were encountered: