MCPcopy Create free account
hub / github.com/EasyWebApp/WebCell / connectedCallback

Method connectedCallback

source/WebCell.tsx:78–101  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77
78 async connectedCallback() {
79 const { mode } = meta;
80 const renderChildren = !(mode != null);
81
82 const { root } = this,
83 events = eventMap.get(this) || [];
84
85 for (const { type, selector, handler } of events) {
86 if (renderChildren && /^:host/.test(selector))
87 console.warn(
88 `[WebCell] DOM Event delegation of "${selector}" won't work if you don't invoke "this.attachShadow()" manually.`
89 );
90 root.addEventListener(type, handler);
91 }
92
93 super['connectedCallback']?.();
94
95 if (this.mounted) return;
96
97 await this.update();
98
99 this.mounted = true;
100 this.mountedCallback?.();
101 }
102
103 declare render?: () => VNode;
104 declare updatedCallback?: () => any;

Callers

nothing calls this directly

Calls 1

updateMethod · 0.95

Tested by

no test coverage detected