diff --git a/docs/components/examples/introducing/motivation.js b/docs/components/examples/introducing/motivation.js new file mode 100644 index 0000000..e476f35 --- /dev/null +++ b/docs/components/examples/introducing/motivation.js @@ -0,0 +1,36 @@ +import { el, on } from "deka-dom-el"; +import { S } from "deka-dom-el/signals"; +document.body.append( + el(HelloWorldComponent, { initial: "🚀" }) +); +/** @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