Skip to content

Commit

Permalink
reflect api changes in mubsub 0.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Polidore committed Dec 4, 2013
1 parent e2e009d commit 8007223
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
14 changes: 10 additions & 4 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,18 @@ module.exports = function(config) {

return {
listen: function(cb) {
channel.subscribe({ss: 1}, function(doc) {
cb(doc.msg);
channel.subscribe('ss', function(msg) {
if(!msg) {
throw 'Null message';
}
cb(msg);
});
},
send: function(obj) {
channel.publish({ss: 1, msg: obj});
send: function(msg) {
if(!msg) {
throw "Cannot publish null message"
}
channel.publish('ss', msg);
}
};
};
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "ss-mubsub",
"description": "Easy integration of mubsub into socketstream as pub sub transport",
"author": "Ben Polidore <polidore@gmail.com>",
"version": "0.1.0",
"version": "0.2.0",
"main": "./lib/index.js",
"repository": {
"type": "git",
Expand All @@ -12,7 +12,7 @@
"node": ">= 0.8.0"
},
"dependencies": {
"mubsub": ">= 0.2.0"
"mubsub": ">= 0.2.1"
},
"devDependencies": {
}
Expand Down

0 comments on commit 8007223

Please sign in to comment.