lib/rails/generators/channel/templates/javascript/channel.js.tt in actioncable-6.0.0.beta1 vs lib/rails/generators/channel/templates/javascript/channel.js.tt in actioncable-6.0.0.beta2
- old
+ new
@@ -1,16 +1,16 @@
import consumer from "./consumer"
consumer.subscriptions.create("<%= class_name %>Channel", {
- connected: function() {
+ connected() {
// Called when the subscription is ready for use on the server
},
- disconnected: function() {
+ disconnected() {
// Called when the subscription has been terminated by the server
},
- received: function(data) {
+ received(data) {
// Called when there's incoming data on the websocket for this channel
}<%= actions.any? ? ",\n" : '' %>
<% actions.each do |action| -%>
<%=action %>: function() {
return this.perform('<%= action %>');