|
|
|
|
|
by TravelTechGuy
2698 days ago
|
|
Not sure if it had been mentioned already, but I think we could benefit from cancellable Promises. Many of the modules and libraries currently support Promises, and `async/await`, but try to find a way to cancel a long-running Promise. Some libraries have resorted to using their own mechanisms, and some (e.g. `axios`) resorted to using a withdrawn TC39 proposal. I'd like a standard, easy way to cancel a Promise. I know it's not simple, and Promises can wrap around other Promises, etc. but if I'm e.g. uploading a large file to a server, there should be an easy way to provide my users with a "cancel" button that works. |
|
[1] https://developer.mozilla.org/en-US/docs/Web/API/AbortContro...
[2] https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API