diff --git a/docs/components/examples/introducing/helloWorld.js b/docs/components/examples/introducing/helloWorld.js index 47c0fe9..9aaa6bf 100644 --- a/docs/components/examples/introducing/helloWorld.js +++ b/docs/components/examples/introducing/helloWorld.js @@ -1,15 +1,19 @@ import { el } from "deka-dom-el"; import { S } from "deka-dom-el/signals"; -const clicks= S(0); // A -document.body.append( - el().append( +const threePS= ({ emoji= "🚀" })=> { + const clicks= S(0); // A + return el().append( el("p", S(()=> - "Hello World "+"🎉".repeat(clicks()) // B + "Hello World "+emoji.repeat(clicks()) // B )), el("button", { type: "button", onclick: ()=> clicks(clicks()+1), // C textContent: "Fire", }) - ) + ); +}; +document.body.append( + el(threePS, { emoji: "🎉" }), ); +