-
-
Save anka/f96ee16eb1681afd445223c02fafd68e to your computer and use it in GitHub Desktop.
Subscribe to the notification channel via action cable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
App.quote_generation = App.cable.subscriptions.create channel: "NotificationChannel", param1: value1, | |
connected: -> | |
# Called when the subscription is ready for use on the server | |
disconnected: -> | |
# Called when the subscription has been terminated by the server | |
received: (data) -> | |
# Called when there's incoming data on the websocket for this channel | |
# Add your code here to e.g. update some UI |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment