Fix typo and update doubleValue declaration

This commit is contained in:
Natxo
2026-03-31 10:27:16 +02:00
committed by GitHub
parent c4005a903d
commit 787cf0ec3f

View File

@@ -38,12 +38,12 @@ const Counter = () => {
// One-line persistence: state survives page reloads automatically // One-line persistence: state survives page reloads automatically
const count = $(0, "user-counter-pref"); const count = $(0, "user-counter-pref");
// Computed: automatically updated when value changes // Computed: automatically updated when value changes
const doubleValue = (()=> value() *2); const doubleValue = $(()=> value() *2);
// Create fast HTML with pure JS // Create fast HTML with pure JS
return Div({ class: "card" }, [ return Div({ class: "card" }, [
H1(`Count: ${count()}`), H1(`Count: ${count()}`),
dobleValue() doubleValue()
P("Atomic updates. Zero re-renders of the parent tree."), P("Atomic updates. Zero re-renders of the parent tree."),
Button({ Button({
onclick: () => count(c => c + 1), onclick: () => count(c => c + 1),