From e884f871b07c6111a3c30ef31b7767f7e8ff9df7 Mon Sep 17 00:00:00 2001 From: Jan Andrle Date: Fri, 13 Dec 2024 19:37:52 +0100 Subject: [PATCH] :zap: better helloWorld.js --- docs/components/examples/introducing/helloWorld.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) 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: "🎉" }), ); +