David Bruant (2013-07-10T18:22:40.000Z)
github at esdiscuss.org (2013-07-12T02:27:45.694Z)
Le 10/07/2013 20:00, Matthew Robb a ?crit : > I'd rather do something like: > > ```js > Object.addEventListener(obj, "eventName", function(){}); > ``` > > I think this matches very closely the way you do property descriptors > and I'd love to see > > ```js > var obj = { > on eventName() {} > } > ``` That's the spirit. I don't care for particular syntax, but that's what I had in mind too. A while ago, I started a library to have first-class events as object properties in specialized proxies [1]. It has some inherent limitations but is a start in one direction. [1]: https://github.com/DavidBruant/HarmonyProxyLab/tree/EventedObjectsOnDirectProxies/EventedObject