-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcounter.html
More file actions
34 lines (33 loc) · 1 KB
/
counter.html
File metadata and controls
34 lines (33 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="shortcut icon" type="image/x-icon" href="../favicon.ico">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/water.css">
<title>Counter - The Merlin JS framework</title>
</head>
<body>
<main>
<h1><img src="../favicon.ico"> Counter: <span text:="count"></span></h1>
<button onclick:="dec">-</button>
<button onclick:="inc">+</button>
</main>
<script type="module">
import {app} from "../index.js"
app({
node: document.body.querySelector('main'),
init: 0,
register: update => ({
inc: () => update(count => count + 1),
dec: () => update(count => count - 1)
}),
view: (count, events) => ({
count,
...events
})
})
</script>
</body>
</html>