Last active
March 6, 2018 15:33
-
-
Save yoshuawuyts/aac6310d76f2f22c6a3692b10a2d362b to your computer and use it in GitHub Desktop.
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 { App } = require('choo') | |
var app = new App() | |
app.store(import('./stores/my-store')) | |
app.render('body') |
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 { Store } = require('choo') | |
export class myStore extends Store { | |
static get name () { | |
return 'my-store' | |
} | |
load () { | |
this.emitter.on('foo', this.foo) | |
} | |
foo () { | |
this.emitter.emit('log:info', 'hello world') | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment