mirror of
https://github.com/jaandrle/deka-dom-el
synced 2024-11-22 16:55:23 +01:00
9 lines
273 B
JavaScript
9 lines
273 B
JavaScript
import { S } from "deka-dom-el/signals";
|
||
// α — `signal` represents a reactive value
|
||
const signal= S(0);
|
||
// β — just reacts on signal changes
|
||
S.on(signal, console.log);
|
||
// γ — just updates the value
|
||
signal(signal()+1);
|
||
setInterval(()=> signal(signal()+1), 5000);
|