mirror of
https://github.com/Hopiu/postal.js.git
synced 2026-03-16 22:20:23 +00:00
Updating postal.channel to allow for string topic args only
This commit is contained in:
parent
b48bdfc276
commit
829d5504ba
1 changed files with 3 additions and 2 deletions
|
|
@ -20,8 +20,9 @@ var postal = {
|
|||
},
|
||||
|
||||
channel: function(options) {
|
||||
var channel = options.channel || DEFAULT_CHANNEL,
|
||||
tpc = options.topic;
|
||||
var channel, tpc;
|
||||
tpc = (Object.prototype.toString.call(options) === "[object String]") ? options : options.topic;
|
||||
channel = options.channel || DEFAULT_CHANNEL;
|
||||
return new ChannelDefinition(channel, tpc);
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue