- From: Jake Archibald <notifications@github.com>
- Date: Thu, 04 Feb 2021 08:48:04 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Thursday, 4 February 2021 16:48:17 UTC
@benjamingr is there a real example you could point to that would benefit from this? I find that I'm either using checkpoints, which is why I proposed https://github.com/whatwg/dom/issues/927, or I'm taking a thing that doesn't support signal and passing it to something like this: ```js async function abortable(signal, promise) { if (signal.aborted) throw new DOMException('AbortError', 'AbortError'); let listener; return Promise.race([ new Promise((_, reject) => { listener = () => reject(new DOMException('AbortError', 'AbortError')); signal.addEventListener('abort', listener); }), promise, ]).finally(() => signal.removeEventListener('abort', listener)); } ``` -- 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-773449680
Received on Thursday, 4 February 2021 16:48:17 UTC