0.1.0 • Published 8 years ago

seneca-pubsub v0.1.0

Weekly downloads
16
License
MIT
Repository
github
Last release
8 years ago

Seneca

A Seneca.js data storage plugin.

seneca-pubsub

npm version Build Status Coverage Status Dependency Status Gitter

A decoration that adds pub sub via Varo to Seneca

If you're using this module, and need help, you can:

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.