Re: [w3c/webcomponents] Need a callback for when children changed or parser finished parsing children (#809)

> @rniwa it seems to me that the combination of childrenChangedCallback, customElements.whenDefined(), plus some bookkeeping is all you need for that. Though perhaps if the bookkeeping gets too complicated there is some kind of shortcut we could offer if libraries all end up with something similar. (Seems like something user land should figure out the pattern first for though.) 

To give some color about what I've been doing for this situation: I generally fire events from children when they're ready to interact with an ancestor, and have the child wait for the parent to be ready to receive the event with `customElements.whenDefined()`. This seems to be simpler code usually and avoids tightly coupling to the exact structure of the DOM (works with grandchildren as well).

-- 
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/809#issuecomment-489163814

Received on Friday, 3 May 2019 16:49:53 UTC