1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-04-03 04:25:53 +02:00
2024-12-11 16:20:49 +01:00

19 lines
390 B
JavaScript

import { el } from "deka-dom-el";
import { S } from "deka-dom-el/signals";
document.body.append(
el(HelloWorldComponent)
);
function HelloWorldComponent(){
const clicksS= S(0); // A
return el().append(
el("p", S(()=>
"Hello World "+"🎉".repeat(clicksS()) // B
)),
el("button", {
type: "button",
onclick: ()=> clicksS(clicksS()+1), // C
textContent: "Fire",
})
)
}