mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-04-02 20:15:53 +02:00
* :tap: removed on.attributeChanged and static observedAttributes * ⚡ import optimalization * ⚡ scope.signal * 🔤 🐛 * ⚡ 🐛 registerReactivity and types * 🔤 * ⚡ * 🔤 * 🐛 Node in enviroment * ⚡ todos * ⚡ * ⚡ 🔤 * ⚡ lint * ⚡ memo * 🔤 🐛 memo * ⚡ 🔤 todomvc * 🐛 types * 🔤 p08 signal factory * 🔤 ⚡ types * ⚡ 🔤 lint * 🔤 * 🔤 * 🔤 * 🔤 * 📺
19 lines
533 B
JavaScript
19 lines
533 B
JavaScript
import { el, on } from "deka-dom-el";
|
|
const paragraph= el("p", "See lifecycle events in console.",
|
|
el=> log({ type: "dde:created", detail: el }),
|
|
on.connected(log),
|
|
on.disconnected(log),
|
|
);
|
|
|
|
document.body.append(
|
|
paragraph,
|
|
el("button", "Update attribute", on("click", ()=> paragraph.setAttribute("test", Math.random().toString()))),
|
|
" ",
|
|
el("button", "Remove", on("click", ()=> paragraph.remove()))
|
|
);
|
|
|
|
/** @param {Partial<CustomEvent>} event */
|
|
function log({ type, detail }){
|
|
console.log({ _this: this, type, detail });
|
|
}
|