Created
February 9, 2017 14:35
-
-
Save selfup/bbf5c07bbac447e36f7e86f73d29754a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// 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