Skip to content

Commit

Permalink
allow broadcasting empty message (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
wellsjo authored and mafintosh committed Nov 22, 2016
1 parent 049e237 commit 2c95fd9
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ SignalHub.prototype.subscribe = function (channel) {

SignalHub.prototype.broadcast = function (channel, message, cb) {
if (this.closed) throw new Error('Cannot broadcast after close')
if (!message) message = {}
if (!cb) cb = noop

var pending = this.urls.length
Expand Down

0 comments on commit 2c95fd9

Please sign in to comment.