1
0
mirror of https://github.com/jaandrle/deka-dom-el synced 2025-12-15 05:43:45 +01:00

♻️ Simplify signals logic (use functions to read/set)

This commit is contained in:
2023-08-24 14:52:46 +02:00
parent 404971f484
commit acdfb4ef57
4 changed files with 26 additions and 32 deletions

View File

@@ -102,8 +102,8 @@ document.body.append(
```js
const value= S("");
document.body.append(
el("span", { style: { fontWeight: "bold" }, textContent: ()=> S(value) }),
el("span", { style: { fontWeight: "bold" }, textContent: value }),
el("input", { type: "text" },
listen("change", event=> S(value, event.target, value)))
listen("change", event=> value(event.target.value)))
);
```