Re: [WICG/webcomponents] The MountObserver api, an alternative lazy custom element definition proposal (#896)

At the risk of spinning _another_ alternative proposal from this alternative proposal, the `MountObserver` looks quite close to something like a `SelectorObserver` - which could fire a callback whenever a given selector changes the amount of matched elements.

Something like this was also discussed in https://github.com/whatwg/html/issues/7039 where folks wanted to know when an element transitions from e.g. `:dir(ltr)` to `:dir(rtl)`, and a few ideas were discussed around `matchSelector(the_selector).addEventListener('change', () => { .. })`. It seems like something more generic like this could benefit all of these use cases. 

-- 
Reply to this email directly or view it on GitHub:
https://github.com/WICG/webcomponents/issues/896#issuecomment-2082161208
You are receiving this because you are subscribed to this thread.

Message ID: <WICG/webcomponents/issues/896/2082161208@github.com>

Received on Monday, 29 April 2024 08:36:49 UTC