Last active
July 14, 2020 06:37
-
-
Save jorgebucaran/8dc33b7947f3193eb2ea3d5700e27036 to your computer and use it in GitHub Desktop.
Getting started with Hyperapp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<script type="module"> | |
import { h, text, app } from "https://unpkg.com/hyperapp" | |
app({ | |
init: () => 0, | |
view: state => | |
h("main", {}, [ | |
h("h1", {}, text(state)), | |
h("button", { onclick: state => state - 1 }, text("-")), | |
h("button", { onclick: state => state + 1 }, text("+")) | |
]), | |
node: document.getElementById("app") | |
}) | |
</script> | |
</head> | |
<body> | |
<main id="app"></main> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment