- From: Andrea Giammarchi <notifications@github.com>
- Date: Thu, 25 Aug 2016 14:15:15 -0700
- To: w3c/webcomponents <webcomponents@noreply.github.com>
Received on Thursday, 25 August 2016 21:15:46 UTC
> e.g. in the _constructor_ there are children during upgrades.
which is why I am personally promoting a different approach such:
```js
class HTMLCustomElement extends HTMLElement {
constructor() {
const self = super();
self.init();
return self;
}
init() {}
}
pos
// so that everyone can extend it via ...
class MyEl extends HTMLCustomElement {
init() {
// any logic previously used as
// createdCallback();
}
}
```
Afaik that logic should have `chindren` and delegate to `connectedCallback` / `disconnectedCallback` the only `addEventListener` / `removeEventListener` or direct `self` node related logic.
Yet this means that developers expectations might need a fix from standards which is usually undesired.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/551#issuecomment-242542837
Received on Thursday, 25 August 2016 21:15:46 UTC