simple-pubsub
v1.1.1
Published
Simple pub sub utility
Downloads
134
Readme
simple-pubsub
Installation
npm install --save simple-pubsub
Simple pubsub module provide 3 methods to use.
- subscribe
- unsubscribe
- publish
Usage
var pubsub = require('simple-pubsub');
var subscriberId = pubsub.subscribe('topic',function callback(topic,data){
console.log(data);
});
pubsub.publish('topic',{'message':'hello'});
pubsub.unsubscribe(subscriberId);