Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
const choo = require('choo')
const html = choo.view
const onload = require('on-load')
const app = choo()
const page1 = (params, state, send) => {
const tree = html`
<h1>Page 1</h1>
<a href="/page2">Page 2</a>
onload(tree, () => console.log('page1 loaded'))
return tree
const page2 = (params, state, send) => {
const tree = html`
<h1>Page 2</h1>
<a href="/">Page 1</a>
onload(tree, () => console.log('page2 loaded'))
return tree
app.router((route) => [
route('/', page1),
route('/page2', page2)
const tree = app.start()

This comment has been minimized.

Copy link

crapthings commented Jul 16, 2016

is this the same lib that we used put

with choo ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.