Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save jonathontoon/ce54a6def4979c027e42b83a97d9d99c to your computer and use it in GitHub Desktop.
Save jonathontoon/ce54a6def4979c027e42b83a97d9d99c to your computer and use it in GitHub Desktop.
routers
const choo = require('choo')
const html = require('choo/html')
const app = choo()
const MainView = (state, prev, send) => {
return html`
<section>Test1</section>
`
}
const ProjectView = (state, prev, send) => {
return html`
<section>Test2</section>
`
}
app.model(require('./model'))
app.router([
[ '/', MainView ],
[ '/project', ProjectView ]
])
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