Re: [whatwg/dom] Specify that AbortController#abort() be bound to AbortController instance (#981)

@jakearchibald fwiw I think the doAbortable model shown in that thread is, at best, moving an existing problem around. The need is to “decorate await”, not to “decorate async”, and it would probably not be great to encourage the latter. That is, usually every interleaving point / control yield would want to “race the signal”. This is always going to be awkward, but the awkwardness can be minimized. I mentioned the `race` util we use in particular for this reason — it’s the “building block” of all the signal patterns we’ve found/needed to date.

I would love to see `signal.race(Promise<any> p)` become native. Once you’re always racing the signal, you get to use catch/finally just like in any other sync or async function. I believe some form of `race`+`isAbortError` would be the minimal API needd to fix the “syntax gap”.

-- 
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/981#issuecomment-845847876

Received on Friday, 21 May 2021 10:20:05 UTC