diff options
author | Javan Makhmali <javan@javan.us> | 2015-06-25 10:32:36 -0400 |
---|---|---|
committer | Javan Makhmali <javan@javan.us> | 2015-06-25 10:32:36 -0400 |
commit | 53d0b22aeeba1a585abe47b4a9417462b812d1a4 (patch) | |
tree | 5789c8f575e7d5ee7b548f7753ae83a6cae6ef59 /lib | |
parent | c7f00661bf0cc54a73ccdb9d27fa10b0fd806e43 (diff) | |
download | rails-53d0b22aeeba1a585abe47b4a9417462b812d1a4.tar.gz rails-53d0b22aeeba1a585abe47b4a9417462b812d1a4.tar.bz2 rails-53d0b22aeeba1a585abe47b4a9417462b812d1a4.zip |
Switch back to original API and callback naming
Diffstat (limited to 'lib')
-rw-r--r-- | lib/assets/javascripts/cable/channel.js.coffee | 6 | ||||
-rw-r--r-- | lib/assets/javascripts/cable/connection.js.coffee | 4 | ||||
-rw-r--r-- | lib/assets/javascripts/cable/subscriber_manager.js.coffee | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/assets/javascripts/cable/channel.js.coffee b/lib/assets/javascripts/cable/channel.js.coffee index 645a44e140..bbdc9c5589 100644 --- a/lib/assets/javascripts/cable/channel.js.coffee +++ b/lib/assets/javascripts/cable/channel.js.coffee @@ -5,11 +5,11 @@ class Cable.Channel @cable.subscribers.add(@identifier, this) # Perform a channel action with the optional data passed as an attribute - sendAction: (action, data = {}) -> + perform: (action, data = {}) -> data.action = action - @sendMessage(data) + @send(data) - sendMessage: (data) -> + send: (data) -> @cable.sendMessage(@identifier, JSON.stringify(data)) unsubscribe: -> diff --git a/lib/assets/javascripts/cable/connection.js.coffee b/lib/assets/javascripts/cable/connection.js.coffee index a318925b97..e987c227c6 100644 --- a/lib/assets/javascripts/cable/connection.js.coffee +++ b/lib/assets/javascripts/cable/connection.js.coffee @@ -31,7 +31,7 @@ class Cable.Connection if data.identifier is '_ping' @pingReceived(data.message) else - @cable.subscribers.notify(data.identifier, "onMessage", data.message) + @cable.subscribers.notify(data.identifier, "received", data.message) onConnect: => @startWaitingForPing() @@ -50,7 +50,7 @@ class Cable.Connection disconnect: -> @removeExistingConnection() @resetPingTime() - @cable.subscribers.notifyAll("onDisconnect") + @cable.subscribers.notifyAll("disconnected") reconnect: -> @disconnect() diff --git a/lib/assets/javascripts/cable/subscriber_manager.js.coffee b/lib/assets/javascripts/cable/subscriber_manager.js.coffee index 4f46efe817..98223d076c 100644 --- a/lib/assets/javascripts/cable/subscriber_manager.js.coffee +++ b/lib/assets/javascripts/cable/subscriber_manager.js.coffee @@ -5,12 +5,12 @@ class Cable.SubscriberManager add: (identifier, subscriber) -> @subscribers[identifier] = subscriber if @cable.sendCommand(identifier, "subscribe") - @notify(identifier, "onConnect") + @notify(identifier, "connected") reload: -> for identifier in Object.keys(@subscribers) if @cable.sendCommand(identifier, "subscribe") - @notify(identifier, "onConnect") + @notify(identifier, "connected") remove: (identifier) -> if subscriber = @subscribers[identifier] |