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

@getify it's kinda nice that one function could do both, but I'm worried it muddies the intent of the method. `abortableTask(signal, callback)` is designed as a best practice way to create a unit of abortable work in a non-leaky way. Whereas `abortableTask(signal)` would create a promise that only resolves when `signal` is aborted. This means any reactions to the promise would leak until `signal` is aborted or goes out of reference, which takes us back to the problem we're trying to address.

Although these things could be the same method implementation-wise, would it make more sense in terms of intent and documentation to make them different methods?

-- 
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-775039009

Received on Monday, 8 February 2021 10:24:14 UTC