Skip to content

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