lib/assets/javascripts/websocket_rails/websocket_rails.js.coffee in websocket-rails-0.4.7 vs lib/assets/javascripts/websocket_rails/websocket_rails.js.coffee in websocket-rails-0.4.8
- old
+ new
@@ -85,9 +85,14 @@
@channels[channel_name] = channel
channel
else
@channels[channel_name]
+ unsubscribe: (channel_name) =>
+ return unless @channels[channel_name]?
+ @channels[channel_name].destroy()
+ delete @channels[channel_name]
+
dispatch_channel: (event) =>
return unless @channels[event.channel]?
@channels[event.channel].dispatch event.name, event.data
supports_websockets: =>