unjs / unenv

🕊️ Convert javaScript code to be runtime agnostic
MIT License
348 stars 18 forks source link

support abort `signal` for direct fetch util #153

Open danielroe opened 7 months ago

danielroe commented 7 months ago

Describe the feature

See: https://github.com/nuxt/nuxt/issues/22684

We don't yet support AbortController meaning that the fetch created with createFetch does not have a way to cancel requests. This may be desirable, depending on the difficulty of implementing a signal, but I thought it would be worth tracking it all the same.

Additional information

pi0 commented 7 months ago

Seems a good idea to have if possible. How do you imagine canceling a direct fetch (which is an async function call) though?