-
-
Save anka/b652b8d0c91408409be2b3882349574c to your computer and use it in GitHub Desktop.
Notification channel implementation
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
class NotificaitonChannel < ApplicationCable::Channel | |
def subscribed | |
# Get the parameter from client side | |
param1 = params['param1'] | |
# Open stream for a parameterized channel | |
stream_from "notification_channel_#{param1}" | |
end | |
def unsubscribed | |
# Any cleanup needed when channel is unsubscribed | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment