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

Support AbortController #1511

Closed
sindresorhus opened this issue Oct 22, 2020 · 2 comments · Fixed by #2020
Closed

Support AbortController #1511

sindresorhus opened this issue Oct 22, 2020 · 2 comments · Fixed by #2020
Labels
enhancement This change will extend Got features future The issue will be worked on in the future ✭ help wanted ✭

Comments

@sindresorhus
Copy link
Owner

sindresorhus commented Oct 22, 2020

Node.js 15 now supports AbortController and it makes sense for us to support it in Got. While I'm personally not a big fan of its overly verbose way of handling cancellation, it seems to become the de-facto way of handling cancellation going forward.

I think we should still retain the current .cancel() method if possible.

https://medium.com/@nodejs/node-js-v15-0-0-is-here-deb00750f278
https://developer.mozilla.org/en-US/docs/Web/API/AbortController
nodejs/node@8390f8a86b

@sindresorhus sindresorhus added enhancement This change will extend Got features ✭ help wanted ✭ labels Oct 22, 2020
@szmarczak
Copy link
Collaborator

I think we should still retain the current .cancel() method if possible.

👍 Maybe throw if the signal option is provided? That way we would avoid ambiguity.

@sindresorhus
Copy link
Owner Author

👍 Maybe throw if the signal option is provided?

👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This change will extend Got features future The issue will be worked on in the future ✭ help wanted ✭
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants