seneca-pubsub
v0.1.0
Published
A decoration that adds pub sub via Varo to Seneca
Downloads
3
Maintainers
Readme
A Seneca.js data storage plugin.
seneca-pubsub
A decoration that adds pub sub via Varo to Seneca
If you're using this module, and need help, you can:
- Post a github issue,
- Tweet to @senecajs,
- Ask on the Gitter.
If you are new to Seneca in general, please take a look at senecajs.org. We have everything from tutorials to sample apps to help get you up and running quickly.
Install
This plugin, simply use npm,
npm install seneca
npm install seneca-pubsub
Test
To run tests, simply use npm:
npm run test
Quick Example
var seneca = require('seneca')()
seneca.use(require('seneca-pubsub'))
seneca.subscribe({role: 'foo'}, function (msg) {
console.log(msg.data.value)
})
seneca.subscribe({role: 'foo'}, function (msg) {
console.log(msg.data.value)
})
seneca.publish({role: 'foo', data: {value: 10}})
seneca.publish({role: 'foo', data: {value: 10}})
seneca.publish({role: 'foo', data: {value: 10}})
// Output x6: '10'
Contributing
The Senecajs org encourages open participation. If you feel you can help in any way, be it with documentation, examples, extra testing, or new features please get in touch.
License
Copyright (c) 2015, Dean McDonnell and other contributors. Licensed under MIT.