We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
You can continue the conversation there. Go to discussion →
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
⚠️ This proposal isn't finalized yet.
An abort signal will always be passed to fetcher via the option:
fetcher
useSWR('/api', (url, { signal }) => { return fetch(url, { signal }).then(res => res.json()) })
And SWR will abort the signal when the request is discarded and the result is no longer needed. After aborted, SWR ignores the AbortError thrown.
AbortError
The text was updated successfully, but these errors were encountered:
This is amazing! Elegant and in spirit with SWR's simplicity.
It would cause aborts to happen in applications where none were happening before. But is it a breaking change? I think not.
Sorry, something went wrong.
Looks good! Maybe add a new configurarion option for People who don't want it?
Update use-swr.ts
226bb1d
Looking at vercel#1933
I have given implementation of this a go in the above PR if anyone is competent to have a look and give any feedback? Cheers.
No branches or pull requests
An abort signal will always be passed to
fetcher
via the option:And SWR will abort the signal when the request is discarded and the result is no longer needed. After aborted, SWR ignores the
AbortError
thrown.The text was updated successfully, but these errors were encountered: