Files
buuh/examples/http/views/main.js
T
Yoshua Wuyts 6407188ee9 router: change order of arguments
fixup! freeze state & rename app ns to location
2016-07-02 22:54:35 +02:00

15 lines
394 B
JavaScript

const html = require('../../../html')
module.exports = function (state, prev, send) {
const error = state.app.errors[0]
const title = state.api.title
return html`
<section>
<h1>${title}</h1>
<h2>Latest error: ${error}</h2>
<button onclick=${(e) => send('api:good')}>OK!</button>
<button onclick=${(e) => send('api:bad')}>Naughty</button>
</section>
`
}