From c4005a903de04ce2bb04b6014a8e449ed6e31ddb Mon Sep 17 00:00:00 2001 From: Natxo <1172351+natxocc@users.noreply.github.com> Date: Tue, 31 Mar 2026 10:24:22 +0200 Subject: [PATCH] Enhance Readme with code examples Added example HTML and JavaScript code snippets to illustrate reactive components. --- Readme.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Readme.md b/Readme.md index ef8138b..09fdc7a 100644 --- a/Readme.md +++ b/Readme.md @@ -27,13 +27,23 @@ While other frameworks "guess" what changed by comparing massive DOM trees (Diff Create reactive, persistent components with a syntax that feels like Vanilla JS, but works like magic: +```html +
+``` + ```javascript const Counter = () => { + // Simple signal + const value = $(100); // 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 + const doubleValue = (()=> value() *2); + // Create fast HTML with pure JS return Div({ class: "card" }, [ H1(`Count: ${count()}`), + dobleValue() P("Atomic updates. Zero re-renders of the parent tree."), Button({ onclick: () => count(c => c + 1),