Last active
December 18, 2017 12:33
-
-
Save tornqvist/840a5a60cfce7f2e540b6f85c2a02290 to your computer and use it in GitHub Desktop.
Choo cache thing
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
var html = require('choo/html') | |
var button = require('./button') | |
// button.get('form-button') -> Instance of button with key "form-button" | |
module.exports = form | |
function form (isLoading, emit) { | |
return html` | |
<form> | |
${button.render('form-button', 'Click me!', isLoading ? null : onclick)} | |
</form> | |
` | |
function onclick () { | |
emit('submit') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment