Skip to content

Instantly share code, notes, and snippets.

@okdistribute
Created November 23, 2016 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okdistribute/c91d8bf297a4b2bc40b21728954a14c6 to your computer and use it in GitHub Desktop.
Save okdistribute/c91d8bf297a4b2bc40b21728954a14c6 to your computer and use it in GitHub Desktop.
var choo = require('choo')
var html = require('choo/html')
var app = choo()
const view = (state, prev, send) => {
function submitButton () {
console.log('hi')
}
return html`
<div>
<button onclick="${submitButton}">go</button>
</div>`
}
app.router((route) => [
route('/', view)
])
const tree = app.start()
document.body.appendChild(tree)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment