Skip to content

Instantly share code, notes, and snippets.

@selfup
Created February 9, 2017 14:35
Show Gist options
  • Save selfup/bbf5c07bbac447e36f7e86f73d29754a to your computer and use it in GitHub Desktop.
Save selfup/bbf5c07bbac447e36f7e86f73d29754a to your computer and use it in GitHub Desktop.
// here we import 'html' instead of just 'h'
import { html } from 'hyperapp';
// now we use the 'html`` template tag literal
const view = (model, msg) => (html`
<div class="counter">
<h1>Welcome to the hyperapp-one boilerplate!</h1>
<p><em>With JSX</em></p>
<hr class="line-break" />
<section>
<button
class="add"
onclick=${msg.add}
>
+
</button>
<h1>${model.num}</h1>
<button
class="sub"
onclick=${msg.sub}
disabled=${model.num <= 0}
>
-
</button>
</section>
</div>
`);
export default view;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment