Subscribe in a way which is currently documented in pusher docs

This commit is contained in:
Piotr Sarnacki 2014-02-27 17:45:43 +01:00
parent 077f555af3
commit be0f601a4c

View File

@ -26,10 +26,8 @@ $.extend Travis.Pusher.prototype,
subscribeAll: (channels) -> subscribeAll: (channels) ->
for channel in channels for channel in channels
name = @prefix(channel) name = @prefix(channel)
unless @pusher.channels.find(name) channel = @pusher.subscribe(channel)
channel = @pusher.channels.add(name, this) channel.bind_all((event, data) => @receive(event, data))
channel.bind_all((event, data) => @receive(event, data))
@pusher.subscribeAll()
subscribe: (channel) -> subscribe: (channel) ->
console.log("subscribing to #{channel}") console.log("subscribing to #{channel}")