TLDR Web Dev · ARTICLES & TUTORIALS

HOW TO ANNUL PROMISES IN JAVASCRIPT

webdeveloper.beehiiv.com4 min read

Summary from the TLDR Web Dev newsletter

JavaScript doesn't natively support canceling Promises. You can use `Promise.withResolvers()` to create cancelable tasks by manually resolving or rejecting Promises. Alternatively, `AbortController` can handle early rejection, which can be used for cancelable fetch requests and sequential request handling in React.