Last active
February 8, 2016 20:25
-
-
Save chiefy/a770c2cccd439e8bd915 to your computer and use it in GitHub Desktop.
weird seneca thing
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 seneca = require('seneca')(); | |
seneca | |
.use('plugin') | |
.add({role: 'plugin', name: 'poop'}, function onPoop(msg, respond) { | |
respond(null, {message: 'this is not from plugin poop!'}); | |
}); | |
seneca.act({role: 'plugin', name: 'poop'}, console.log); | |
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
module.exports = function plugin(options) { | |
this.add({role: 'plugin', name: 'poop'}, function onPoop(msg, respond) { | |
respond(null, {message: 'this is from plugin poop!'}); | |
}); | |
return { name: 'plugin' }; | |
}; |
Author
chiefy
commented
Feb 8, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment