Promise returned by async functions
Posted on 2025-05-24 in Programmation • Tagged with JavaScript, TypeScript
Recently at work, I encountered a problem with a function that should have returned a custom promise subclass. The goal of this subclass is to be able to call a cancel method to cancel some pending action done within the promise and then reject it. It looks like this:
class …
Continue reading