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

Method connectedCallback

www/js/ext/component.js:732–759  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

730 const templateSource = templateEl.textContent;
731 const ComponentClass = class extends HTMLElement {
732 connectedCallback() {
733 if (this._hypercomp_initialized) return;
734 this._hypercomp_initialized = true;
735 this.setAttribute("dom-scope", "isolated");
736 this._slotContent = this.innerHTML;
737 this.innerHTML = "";
738 var internalData = runtime.getInternalData(this);
739 if (!internalData.elementScope) internalData.elementScope = {};
740 internalData.elementScope.attrs = createAttrs(this);
741 if (componentScript) {
742 this.setAttribute("_", componentScript);
743 _hyperscript.process(this);
744 }
745 const self2 = this;
746 var source = substituteSlots(templateSource, self2._slotContent, tagName);
747 queueMicrotask(function() {
748 var result = self2._renderTemplate(source);
749 if (result && result.then) {
750 result.then(function(html) {
751 self2._stampTemplate(html);
752 self2._setupReactiveEffect(source);
753 });
754 } else {
755 self2._stampTemplate(result);
756 self2._setupReactiveEffect(source);
757 }
758 });
759 }
760 disconnectedCallback() {
761 reactivity.stopElementEffects(this);
762 runtime.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