This commit is contained in:
jaandrle committed 2025-03-04 17:52:55 +01:00
1 parent 508d93bb1a
commit 1b0312f6bd
4 files changed
+639 -158

No files matched your search

@@ -0,0 +1,13 @@
import { S } from "deka-dom-el/signals";
// Create base signals
const firstName = S("John");
const lastName = S("Doe");
// Create a derived signal
const fullName = S(() => firstName.get() + " " + lastName.get());
// The fullName signal updates automatically when either dependency changes
S.on(fullName, name => console.log("Name changed to:", name));
firstName.set("Jane"); // logs: "Name changed to: Jane Doe"