- From: Patrick G <notifications@github.com>
- Date: Mon, 22 Apr 2024 09:58:40 -0700
- To: WICG/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 22 April 2024 16:58:44 UTC
I love this proposal. Potentially dumb question. Why not just have the `on` property take either a selector string, or a plain function that returns a boolean? For all the other use cases like media query, instanceof and the like could be static methods on the `MountObserver` class if really needed. like so: ```js const observer = new MountObserver({ on: MountObserver.whereInstanceOf(MyCustomElement), import: './my-element.js', do: { mount: ({localName}, {module}) => { // .... } } }); observer.observe(document); ``` Also, why have a specific `import` property, when that could be handled by the mount function? Thanks. -- Reply to this email directly or view it on GitHub: https://github.com/WICG/webcomponents/issues/896#issuecomment-2070234767 You are receiving this because you are subscribed to this thread. Message ID: <WICG/webcomponents/issues/896/2070234767@github.com>
Received on Monday, 22 April 2024 16:58:44 UTC