- From: Domenic Denicola <d@domenic.me>
- Date: Sat, 7 Nov 2015 09:11:43 +0000
- To: Mitar <mmitar@gmail.com>
- CC: public-webapps <public-webapps@w3.org>
From: Mitar [mailto:mmitar@gmail.com] > Hm, but message port API itself has such a side-effect: I think that is just a very bad API. The platform is unfortunately full of bad APIs :). In particular, a difference between two different ways of adding event listeners is not something authors ever think about. But regardless, if that's all you want, you could do it easily by declaring your custom element class like so: class MyCustomElement { set onmessage(handler) { this.addEventListener("message", handler); this.start(); } // ... } > For me this feels like leaking internal implementation details to the outside. I strongly disagree. I would instead say it feels like getting rid of magical implicit I/O behavior, in favor of making the code say what it does and do what it says.
Received on Saturday, 7 November 2015 09:12:13 UTC