Skip to content

Instantly share code, notes, and snippets.

@chiefy
Last active February 8, 2016 20:25
Show Gist options
  • Save chiefy/a770c2cccd439e8bd915 to your computer and use it in GitHub Desktop.
Save chiefy/a770c2cccd439e8bd915 to your computer and use it in GitHub Desktop.
weird seneca thing
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);
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' };
};
@chiefy
Copy link
Author

chiefy commented Feb 8, 2016

❯ node index.js
2016-02-08T20:20:39.189Z ecosp5nrjixi/1454962839181/35821/- INFO    hello   Seneca/1.0.0/ecosp5nrjixi/1454962839181/35821/-
null { message: 'this is not from plugin poop!' }
❯ node index.js
2016-02-08T20:25:10.431Z e20396s58i76/1454963110418/35945/- INFO    hello   Seneca/1.1.0/e20396s58i76/1454963110418/35945/-
null { message: 'this is from plugin poop!' }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment