Over engineer ElementOnce web components

This commit is contained in:
klmp200 committed 2026-03-26 23:48:40 +01:00
1 parent 3bc4f1300e
commit efdf71d69e
2 files changed
+101 -60

No files matched your search

@@ -36,6 +36,7 @@ export function registerComponent(name: string, options?: ElementDefinitionOptio
**/
export function inheritHtmlElement<K extends keyof HTMLElementTagNameMap>(tagName: K) {
return class Inherited extends HTMLElement {
readonly inheritedTagName = tagName;
protected node: HTMLElementTagNameMap[K];
connectedCallback(autoAddNode?: boolean) {