hyperapp/docs/src/pages/Home/counterCode.js

13 lines
304 B
JavaScript

export default `import { h, app } from "hyperapp"
app({
init: 0,
view: state =>
h("div", {}, [
h("h1", {}, state),
h("button", { onclick: state => state - 1 }, "substract"),
h("button", { onclick: state => state + 1 }, "add")
]),
node: document.getElementById("app")
})`