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

Function registerTemplate

www/js/_hyperscript-max.js:11233–11240  ·  view source on GitHub ↗
(tmpl)

Source from the content-addressed store, hash-verified

11231 var registered = /* @__PURE__ */ new Set();
11232 var fetchedBundles = /* @__PURE__ */ new Map();
11233 function registerTemplate(tmpl) {
11234 var tagName = tmpl.getAttribute("component");
11235 if (!tagName || registered.has(tagName) || customElements.get(tagName)) return;
11236 registered.add(tagName);
11237 var script = tmpl.hasOwnProperty("_componentScript") ? tmpl._componentScript : tmpl.getAttribute("_") || "";
11238 if (tmpl.hasAttribute("_")) tmpl.removeAttribute("_");
11239 registerComponent(tmpl, script || "");
11240 }
11241 function loadComponentBundle(url) {
11242 if (fetchedBundles.has(url)) return fetchedBundles.get(url);
11243 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