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

Hello. 

Another question. Why include the `where` object when creating the observer? Can't all the functions defined there just as well be event listeners? It feels like there's two ways to do the same thing?

```js
const observer = new MountObserver({
   on: MountObserver.whereInstanceOf(MyCustomElement)
   import: './my-element.js',
});

observer.addEventListener('mount', ({localName, module}) => {
      // ....
})

observer.observe(document);

```





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

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

Received on Sunday, 28 April 2024 13:56:57 UTC