Created
March 28, 2017 15:56
-
-
Save djyde/e951ea84b292aefef86a9910937d10cf to your computer and use it in GitHub Desktop.
cans plugin example
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
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