aboutsummaryrefslogtreecommitdiffstats
path: root/lib/assets/javascripts/cable/channel.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'lib/assets/javascripts/cable/channel.js.coffee')
-rw-r--r--lib/assets/javascripts/cable/channel.js.coffee6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/assets/javascripts/cable/channel.js.coffee b/lib/assets/javascripts/cable/channel.js.coffee
index bbdc9c5589..9168a76d3c 100644
--- a/lib/assets/javascripts/cable/channel.js.coffee
+++ b/lib/assets/javascripts/cable/channel.js.coffee
@@ -2,7 +2,7 @@ class Cable.Channel
constructor: (@cable, params = {}, mixin) ->
@identifier = JSON.stringify(params)
extend(this, mixin)
- @cable.subscribers.add(@identifier, this)
+ @cable.subscribers.add(this)
# Perform a channel action with the optional data passed as an attribute
perform: (action, data = {}) ->
@@ -10,10 +10,10 @@ class Cable.Channel
@send(data)
send: (data) ->
- @cable.sendMessage(@identifier, JSON.stringify(data))
+ @cable.send(command: "message", identifier: @identifier, data: JSON.stringify(data))
unsubscribe: ->
- @cable.subscribers.remove(@identifier)
+ @cable.subscribers.remove(this)
extend = (object, properties) ->
if properties?