From 268ee5208ce513eb0b74e2354259e7991d1633c9 Mon Sep 17 00:00:00 2001 From: Javan Makhmali Date: Wed, 24 Jun 2015 14:26:26 -0400 Subject: Create JavaScript channels identified by their Ruby class name --- lib/assets/javascripts/cable.js.coffee | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/assets/javascripts/cable.js.coffee') diff --git a/lib/assets/javascripts/cable.js.coffee b/lib/assets/javascripts/cable.js.coffee index 7c033d3b08..5d5c3a0a53 100644 --- a/lib/assets/javascripts/cable.js.coffee +++ b/lib/assets/javascripts/cable.js.coffee @@ -23,6 +23,11 @@ class @Cable connection.onerror = @reconnect connection + createChannel: (channelName, mixin) -> + channel = channelName + params = if typeof channel is "object" then channel else {channel} + new Cable.Channel this, params, mixin + isConnected: => @connection?.readyState is 1 -- cgit v1.2.3