-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: AbortController shortcut syntax #23
Comments
😶 |
A request-abort is much needed, especially for React/Vue projects. |
It does support For example: const controller = new AbortController();
const signal = controller.signal;
$fetch(url, { signal });
controller.abort(); |
AbortController already works like @xuxucode has posted. I tried it. I think we can close this! |
Indeed. AbortController is supported univerally. I was keeping issue open if we can make a better shortcut syntax for ofetch for canceling requests.. |
In case it could help as inspiration, vueuse provides an abort() function from its version of useFetch() The AbortController instance is created internally. Using ofetch through Nuxt, i mostly use the built-in useFetch composables - not the vueuse one - thus not enjoying this easy-cancellable wizardry. Still it looks like the implementation could be borrowed. |
We expose an auto polyfilled version of |
I would also prefer to have a simple |
ref: https://developer.mozilla.org/en-US/docs/Web/API/AbortController
The text was updated successfully, but these errors were encountered: