Re: [whatwg/dom] Expose an `aborted` promise on AbortSignal? (#946)

> Edit: oh wait, I've just noticed that @Jamesernator's solution depends on the inner task to manually reject its promise if the task aborts. That seems less ergonomic to me. Maybe that's unintentional, since the `requestAnimationFrame` example would never resolve if aborted.

It was intentional at the time, but thinking about it more it might not be necessary. I think I was concerned about the fact the promise would never resolve, but actually it should be fine as if its simply raced against the abort it should in theory be able to be collected as there would be no remaining references to it as once it does a cleanup step like `cancelAnimationFrame` that would sever any references to `resolve`/`reject` and by consequence the promise itself (as `Promise.race` does not actually keep a reference, it just adds a `.then()` handler).



-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/issues/946#issuecomment-774825839

Received on Monday, 8 February 2021 02:30:00 UTC