MCPcopy Create free account
hub / github.com/71/logseq-snippets / constructor

Method constructor

script-block.js:130–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128
129class DefineScriptBlock extends HTMLElement {
130 constructor() {
131 super();
132
133 const name = this.getAttribute("name"),
134 body = this.innerHTML.slice(4, this.innerHTML.length - 3),
135 render = new Function("save", "html", "svg", body);
136
137 defineElement(name, ({ save, html, svg, ...state }) => render.call(state, save, html, svg));
138 }
139}
140
141customElements.define("script-block", ScriptBlock);

Callers

nothing calls this directly

Calls 1

defineElementFunction · 0.85

Tested by

no test coverage detected