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

Function registerTemplate

www/js/ext/component.js:822–829  ·  view source on GitHub ↗
(tmpl)

Source from the content-addressed store, hash-verified

820 var registered = /* @__PURE__ */ new Set();
821 var fetchedBundles = /* @__PURE__ */ new Map();
822 function registerTemplate(tmpl) {
823 var tagName = tmpl.getAttribute("component");
824 if (!tagName || registered.has(tagName) || customElements.get(tagName)) return;
825 registered.add(tagName);
826 var script = tmpl.hasOwnProperty("_componentScript") ? tmpl._componentScript : tmpl.getAttribute("_") || "";
827 if (tmpl.hasAttribute("_")) tmpl.removeAttribute("_");
828 registerComponent(tmpl, script || "");
829 }
830 function loadComponentBundle(url) {
831 if (fetchedBundles.has(url)) return fetchedBundles.get(url);
832 var p = fetch(url).then(function(r) {

Callers 2

loadComponentBundleFunction · 0.70
componentPluginFunction · 0.70

Calls 2

registerComponentFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected