mirror of
https://github.com/jaandrle/deka-dom-el
synced 2025-12-13 04:56:27 +01:00
🔤 adds debugging
This commit is contained in:
14
docs/components/examples/debugging/consoleLog.js
Normal file
14
docs/components/examples/debugging/consoleLog.js
Normal file
@@ -0,0 +1,14 @@
|
||||
// Debugging a (derived) signal with `console.log`
|
||||
import { S } from "deka-dom-el/signals";
|
||||
const name= S("Alice");
|
||||
const greeting = S(() => {
|
||||
// log derived signals
|
||||
const log = "Hello, " + name.get();
|
||||
console.log(log);
|
||||
return log;
|
||||
});
|
||||
|
||||
// log signals in general
|
||||
S.on(greeting, value => console.log("Greeting changed to:", value));
|
||||
|
||||
name.set("Bob"); // Should trigger computation and listener`)
|
||||
Reference in New Issue
Block a user