- From: Domenic Denicola <notifications@github.com>
- Date: Fri, 03 Dec 2021 11:02:56 -0800
- To: whatwg/dom <dom@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Friday, 3 December 2021 19:03:09 UTC
Seems correct, although we should realize this discussion has moved fast and hasn't had time for everyone to weigh in.
Also
> Using Promise.race() should handle the race conditions when there are multiple events that can be expected.
might deserve some more thought, per @bathos's comment. His footnote made me wonder about
```js
const messageEvent = await window.toPromise("message", { errorType: "messageerror" });
```
or something?
... also, writing that out, `toPromise()` is now feeling less good as a name, because I forgot that usually `EventTarget`s are actually objects with tons of non-event functionality (like `Window`), so it feels funny to say `window.toPromise()` as if we're converting the window itself into a promise :(. Same for `toAsyncIterator()`. Sigh, more bikeshedding needed...
- `window.eventAsync("message")` / `window.eventsAsync("message")` ?
- `window.eventPromise("message")` / `window.eventIterator("message")` ?
--
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/1038#issuecomment-985757593
Received on Friday, 3 December 2021 19:03:09 UTC