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

Feature to cancel ongoing XHR request if component unloaded #94

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

SteJaySulli
Copy link
Contributor

  • On very dynamic pages, the component could be unloaded while an XHR is ongoing
  • In these circumstances and error is displayed to the console
  • This is largely cosmetic; the error doesn't break functionality
  • See https://github.com/axios/axios#cancellation for implementation details

- On very dynamic pages, the component could be unloaded while an XHR is ongoing
- In these circumstances and error is displayed to the console
- This is largely cosmetic; the error doesn't break functionality
- See https://github.com/axios/axios#cancellation for implementation details
Copy link
Contributor

@dextermb dextermb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice idea. It'd remove the error/warning for trying to set state for unmounted components.

src/AjaxDynamicDataTable.jsx Outdated Show resolved Hide resolved
src/AjaxDynamicDataTable.jsx Outdated Show resolved Hide resolved
src/AjaxDynamicDataTable.jsx Outdated Show resolved Hide resolved
SteJaySulli and others added 3 commits March 13, 2020 08:47
Co-Authored-By: Dexter Marks-Barber <dexter@marks-barber.co.uk>
Co-Authored-By: Dexter Marks-Barber <dexter@marks-barber.co.uk>
@SteJaySulli
Copy link
Contributor Author

Thanks @dextermb for the suggestions, I've merged these in.

@dextermb
Copy link
Contributor

@SteJaySulli Looks good other than minor style changes 👍

@SteJaySulli SteJaySulli requested a review from DivineOmega March 13, 2020 09:11
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