Re: [whatwg/dom] Consider adding Promise-based API for listerning event (#333)

I don't think this is a problem for this proposal. This Promise-based API would behave like a listener added with `once` specified. So it is a one-off thing. If you need to continuously monitor an event like `mousemove`, it makes no sense to use it. It is mostly for replacing the structure of
```js
elem.addEventListener(type, function handler() {
  elem.removeEventListener(type, handler);
  doSomething();
});
```
or the new syntax
```js
elem.addEventListener(type, function() {
  doSomething();
}, {once: true});
```
with
```js
await elem.on(type);
doSomething();
```

-- 
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/333#issuecomment-276821851

Received on Wednesday, 1 February 2017 23:52:05 UTC