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

Cancelable fetch for Calendar #84

Open
KindaOK opened this issue Jan 17, 2022 · 1 comment
Open

Cancelable fetch for Calendar #84

KindaOK opened this issue Jan 17, 2022 · 1 comment

Comments

@KindaOK
Copy link
Collaborator

KindaOK commented Jan 17, 2022

When the fetch runs on the calendar, and the user navigates away from the component before the fetch completes. We end up with it trying to setState on an unmounted component, which is bad. The options are kinda nasty with one being that we have a variable isMounted, or something of the sort. Cancelled promises also don't really exist natively, so we either have to add some dependencies (rxjs I would be fine with actually, but I think it's heavy and I would rather not add more dependencies if possible), or copy-paste a bunch of code to poylfill it. Hateful either way.

@KindaOK
Copy link
Collaborator Author

KindaOK commented Jan 19, 2022

https://developer.mozilla.org/en-US/docs/Web/API/AbortController
Already compatible with everything except IE, and I don't think that polyfill will kill us.

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

No branches or pull requests

1 participant