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

Function registerTemplate

src/ext/component.js:272–281  ·  view source on GitHub ↗
(tmpl)

Source from the content-addressed store, hash-verified

270 var fetchedBundles = new Map();
271
272 function registerTemplate(tmpl) {
273 var tagName = tmpl.getAttribute('component');
274 if (!tagName || registered.has(tagName) || customElements.get(tagName)) return;
275 registered.add(tagName);
276 var script = tmpl.hasOwnProperty('_componentScript')
277 ? tmpl._componentScript
278 : (tmpl.getAttribute('_') || '');
279 if (tmpl.hasAttribute('_')) tmpl.removeAttribute('_');
280 registerComponent(tmpl, script || '');
281 }
282
283 function loadComponentBundle(url) {
284 if (fetchedBundles.has(url)) return fetchedBundles.get(url);

Callers 2

loadComponentBundleFunction · 0.70
componentPluginFunction · 0.70

Calls 2

registerComponentFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected