Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

About AbortController #27

Closed
jonschlinkert opened this issue Mar 7, 2021 · 2 comments
Closed

About AbortController #27

jonschlinkert opened this issue Mar 7, 2021 · 2 comments

Comments

@jonschlinkert
Copy link
Contributor

The readme says the following:

image

However, the AbortController interface is primarily targeted at web requests, and since p-cancelable is useful for a lot more than web requests, it might be worth clarifying that in the readme.

@sindresorhus
Copy link
Owner

sindresorhus commented Mar 7, 2021

However, the AbortController interface is primarily targeted at web requests, and since p-cancelable is useful for a lot more than web requests, it might be worth clarifying that in the readme.

That is not entirely correct. Node.js is adding it to a lot of APIs. The stream, child_process, and fs module supports it now. Yes, AbortController started as a way to cancel web requests in the browser, since the standard committees could never decide how to add cancellation to promises. However, since there's no better alternative, a lot of projects are adopting it for everything.


I don't plan to deprecate this package, but I also think it's better to standardize on a single thing, and it looks like AbortController is winning.

@jonschlinkert
Copy link
Contributor Author

TIL:

Node.js is adding it to a lot of APIs. The stream, child_process, and fs module supports it now

Nice, I wasn't aware of that! I have some reading to do.

This just proves Cunningham's Law is correct, once again.

Closing, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants