Skip to content
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

Include 'abort' functionality in order to cancel fetch request #59

Open
wants to merge 26 commits into
base: master
Choose a base branch
from

Conversation

Cherrerotinoco
Copy link

Approaching this issue published in this thread, we came up with this solution that implements Abort Controller Interface.

Simple to use , as the only requirement its to pass by options paramater the property of: {abortController: true} so that the Hook -useFetch- returns the function that allows you to cancel the request when its needed.

...
const { isLoading, data, abort } = useFetch(fetchUrl, {
    abortController: true,
  });
...

@Cherrerotinoco Cherrerotinoco mentioned this pull request Oct 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants