Last active
April 28, 2017 13:34
-
-
Save yoshuawuyts/bb5988cc6a920bfe39a15a64a1f17f15 to your computer and use it in GitHub Desktop.
This file contains 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 scheduler = Scheduler() | |
var mainComponent = scheduler.new('main') // create a new component with a name | |
mainComponent.on('render', function (state, emit) { | |
return html`` | |
}) | |
mainComponent.on('load', function (done) { | |
/* trigger an animation that runs for 500ms */ | |
setTimeout(500, done) // wait for animation to complete before calling "done" | |
}) | |
mainComponent.on('unload', function (done) { | |
/* trigger an animation that runs for 200ms */ | |
setTimeout(200, done) // wait for animation to complete before calling "done" | |
}) | |
var app = choo() | |
app.route('/', function (state, emit) { | |
return html` | |
<main> | |
${scheduler.render('main', state, emit)} | |
</main> | |
` | |
}) | |
app.mount('body') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment