diff --git a/docs/components/examples/introducing/helloWorld.js b/docs/components/examples/introducing/helloWorld.js index e476f35..47c0fe9 100644 --- a/docs/components/examples/introducing/helloWorld.js +++ b/docs/components/examples/introducing/helloWorld.js @@ -1,36 +1,15 @@ -import { el, on } from "deka-dom-el"; +import { el } from "deka-dom-el"; import { S } from "deka-dom-el/signals"; +const clicks= S(0); // A document.body.append( - el(HelloWorldComponent, { initial: "🚀" }) + el().append( + el("p", S(()=> + "Hello World "+"🎉".repeat(clicks()) // B + )), + el("button", { + type: "button", + onclick: ()=> clicks(clicks()+1), // C + textContent: "Fire", + }) + ) ); -/** @typedef {"🎉" | "🚀"} Emoji */ -/** @param {{ initial: Emoji }} attrs */ -function HelloWorldComponent({ initial }){ - const clicks= S(0); - const emoji= S(initial); - /** @param {HTMLOptionElement} el */ - const isSelected= el=> (el.selected= el.value===initial); - // @ts-expect-error 2339: The