Maybe this is a stupid question, but why does the `slotchange` event exist? A mutation observer can do the one thing slotchange can do, but also much more. #javascript #WebComponents #shadowDOM

@noleli A Mutation Observer CANNOT do the one thing a slotchange can do and that is observe changes through multiple slots...

However, there are lots that a Mutation Observer can do that a slotchange event _could/should_: https://github.com/WICG/webcomponents/issues/933

Options for controlling specifics of "slotchange" events? · Issue #933 · WICG/webcomponents

By default a <slot> observes its children with just about the least complex options of a Mutation Observer. Essentially, new MutationObserver((mutationsList) => { for(const mutation of mutationsLis...

GitHub
@westbrook that’s a great, flexible suggestion. @deebloo and I were talking about a more limited form of this https://indieweb.social/@deebloo/110741171674282080