Re: [w3c/webcomponents] Add dispatcherEvent for callbacks (#489)

The shadow root can't be null because you're creating it right before calling `querySelector` on it in your example.  It seems more likely that `<tag-b>` isn't present in the tree.

Having a _created_ event doesn't make sense because you cannot attach an event listener to something until it's created (`createdCallback` is now the class constructor).  You might argue the case for event delegation, but it has the same issues as mutation events.  If you meant "upgraded", then you either need to dispatch an event yourself (as in your second example) or take another look at your process to see if you could do it a better way.

Ultimately, it's better left to the component developer to dispatch a _ready_ event, as there may be work that needs to be done asynchronously upon creation or an element could be created outside the document and only attached later.

---
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/489#issuecomment-215471921

Received on Thursday, 28 April 2016 15:44:17 UTC