Skip to content

Commit

Permalink
basic html test
Browse files Browse the repository at this point in the history
  • Loading branch information
seyacat committed Dec 21, 2023
1 parent 9a09a14 commit c29a2f1
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions test/basictest.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>test</title>
</head>
<body>
<script src="https://seyacat.github.io/reactive/reactive.js"></script>
<div id="app">
<div id="counter">1</div>
<button onclick="global.counter++">REACTIVE</button>
</div>
<script>
const global = Reactive({ counter: 1 });
global.subscribe("counter", (data) => {
document.getElementById("counter").innerHTML = data.value;
});
setInterval(() => {
global.counter = 0;
}, 10000);
</script>
<!-- built files will be auto injected -->
</body>
</html>

0 comments on commit c29a2f1

Please sign in to comment.