1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2024-11-23 17:19:37 +01:00
deka-dom-el/docs/components/examples/introducing/helloWorld.js

16 lines
319 B
JavaScript
Raw Normal View History

import { el } from "deka-dom-el";
import { S } from "deka-dom-el/signals";
const clicks= S(0); // A
2023-09-26 16:02:10 +02:00
document.body.append(
el().append(
el("p", S(()=>
"Hello World "+"🎉".repeat(clicks()) // B
2023-09-26 16:02:10 +02:00
)),
el("button", {
type: "button",
onclick: ()=> clicks(clicks()+1), // C
textContent: "Fire",
2023-09-26 16:02:10 +02:00
})
)
);