DEV Community

Discussion on: How to cancel a promise in javascript ?

Collapse
 
alexparra profile image
Alex Parra

Think I’ve only seen cancel by timeout with Promise.race[mainPromise, timeoutPromise].
TimeoutPromise throws after a certain amount of time triggering the catch handler of race.