提交 fa0281ae 编写于 作者: J Javan Makhmali

Cable.Channel -> Cable.Subscription

上级 0e5c9e74
#= require_self
#= require cable/subscriber_manager
#= require cable/connection
#= require cable/channel
#= require cable/subscription
class @Cable
@PING_IDENTIFIER: "_ping"
......@@ -10,10 +10,10 @@ class @Cable
@subscribers = new Cable.SubscriberManager this
@connection = new Cable.Connection this
createChannel: (channelName, mixin) ->
createSubscription: (channelName, mixin) ->
channel = channelName
params = if typeof channel is "object" then channel else {channel}
new Cable.Channel this, params, mixin
new Cable.Subscription this, params, mixin
send: (data) ->
@connection.send(data)
class Cable.Channel
class Cable.Subscription
constructor: (@cable, params = {}, mixin) ->
@identifier = JSON.stringify(params)
extend(this, mixin)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册