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