Sha256: a5b4ad304d07513551a83f2a31949c85fac0e2dc4ae7bf24dd36953cf8ef995c
Contents?: true
Size: 785 Bytes
Versions: 24
Compression:
Stored size: 785 Bytes
Contents
app.<%= class_name.camelize(:lower) %>Channel = app.cable.subscriptions.create "<%= class_name %>Channel", connected: -> # Called when the subscription is ready for use on the server if app.currentPage currentPage.trigger 'channel-connected', ['<%= class_name.underscore %>'] disconnected: -> # Called when the subscription has been terminated by the server if app.currentPage currentPage.trigger 'channel-disconnected', ['<%= class_name.underscore %>'] received: (data) -> # Called when there's incoming data on the websocket for this channel if app.currentPage currentPage.trigger 'channel-received', ['<%= class_name.underscore %>', data] <% actions.each do |action| -%> <%= action %>: -> @perform '<%= action %>' <% end -%>
Version data entries
24 entries across 24 versions & 1 rubygems