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

Switch to Promises instead of callbacks #166

Open
BehindTheMath opened this issue Jun 18, 2018 · 5 comments
Open

Switch to Promises instead of callbacks #166

BehindTheMath opened this issue Jun 18, 2018 · 5 comments

Comments

@BehindTheMath
Copy link
Collaborator

Along with #109, we should consider switching to use Promises instead of callbacks. Most environments support it by now, and we can use a polyfill for those that don't.

@BehindTheMath BehindTheMath added this to the 0.3.0 milestone Jun 18, 2018
@BehindTheMath BehindTheMath removed this from the 0.3.0 milestone Mar 10, 2019
@BehindTheMath
Copy link
Collaborator Author

Promises will make cancelling the XHRs more complicated, since currently, native Promises cannot be canceled.

@kinooyume
Copy link

What do you mean ? you can "cancel" a Promise with reject.

@BehindTheMath
Copy link
Collaborator Author

You can reject a Promise, but you cannot abort the fetch request without AbortControllers, which is a newer API, and is not supported by IE.

@imannms
Copy link

imannms commented Mar 27, 2021

@BehindTheMath
Copy link
Collaborator Author

This "polyfill" doesn't actually close the connection when the request is aborted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants