MCPcopy Create free account
hub / github.com/bigskysoftware/_hyperscript / connectedCallback

Method connectedCallback

www/js/_hyperscript-max.js:11143–11170  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

11141 const templateSource = templateEl.textContent;
11142 const ComponentClass = class extends HTMLElement {
11143 connectedCallback() {
11144 if (this._hypercomp_initialized) return;
11145 this._hypercomp_initialized = true;
11146 this.setAttribute("dom-scope", "isolated");
11147 this._slotContent = this.innerHTML;
11148 this.innerHTML = "";
11149 var internalData = runtime2.getInternalData(this);
11150 if (!internalData.elementScope) internalData.elementScope = {};
11151 internalData.elementScope.attrs = createAttrs(this);
11152 if (componentScript) {
11153 this.setAttribute("_", componentScript);
11154 _hyperscript2.process(this);
11155 }
11156 const self2 = this;
11157 var source = substituteSlots(templateSource, self2._slotContent, tagName);
11158 queueMicrotask(function() {
11159 var result = self2._renderTemplate(source);
11160 if (result && result.then) {
11161 result.then(function(html) {
11162 self2._stampTemplate(html);
11163 self2._setupReactiveEffect(source);
11164 });
11165 } else {
11166 self2._stampTemplate(result);
11167 self2._setupReactiveEffect(source);
11168 }
11169 });
11170 }
11171 disconnectedCallback() {
11172 reactivity2.stopElementEffects(this);
11173 runtime2.cleanup(this);

Callers

nothing calls this directly

Calls 6

createAttrsFunction · 0.70
substituteSlotsFunction · 0.70
getInternalDataMethod · 0.45
_renderTemplateMethod · 0.45
_stampTemplateMethod · 0.45
_setupReactiveEffectMethod · 0.45

Tested by

no test coverage detected