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

What makes that any different than what you can do already? It's fairly easy to pull into a utility function.

```js
function on(elem, type) {
    return new Promise(resolve => {
        elem.addEventListener(type, function listener(ev) {
            this.removeEventListener(type, listener, false)
            resolve(ev)
        }, false)
    })
}
```

And given the new `once` option, I seriously doubt such a thing is worth it.

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

Received on Thursday, 2 February 2017 06:38:47 UTC