Skip to content

Instantly share code, notes, and snippets.

@jorgebucaran
Last active Jul 14, 2020
Embed
What would you like to do?
Getting started with Hyperapp
<!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