Skip to content

Instantly share code, notes, and snippets.

@djyde
Created March 28, 2017 15:56
Show Gist options
  • Save djyde/e951ea84b292aefef86a9910937d10cf to your computer and use it in GitHub Desktop.
Save djyde/e951ea84b292aefef86a9910937d10cf to your computer and use it in GitHub Desktop.
cans plugin example
const loggerPlugin = {
namespace 'logger',
observable: app => msg => {
somewhere.log(msg)
}
}
app.use(loggerPlugin)
app.model({
namespace: 'foo',
observable: app => observable({
click: action.bound(function () {
app.plugins.logger('be clicked')
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment