vanilla, Sometimes #WebComponents need to know what’s happening inside of them.
Whether you’re working with the concept of “slots” or just plain ol’ #HTML, you may need to react to changes imposed from without.
Thankfully, the native platform provides a solution in the form of MutationObserver, an API which is so powerful it can beat at the heart of entire #JS frameworks (Stimulus being but one example).
#WebDev examples by @raymondcamden and @jaredwhite:
https://thathtml.blog/2024/03/more-fun-with-web-components-and-mutationobserver/