Class: Chat::NotificationChannel

Inherits:
ApplicationCable::Channel
  • Object
show all
Defined in:
app/channels/chat/notification_channel.rb

Instance Method Summary collapse

Instance Method Details

#follow(data) ⇒ Object



4
5
6
7
# File 'app/channels/chat/notification_channel.rb', line 4

def follow(data)
  stop_all_streams
  stream_from "users::#{data['user_id']}::chats"
end

#unsubscribedObject



9
10
11
# File 'app/channels/chat/notification_channel.rb', line 9

def unsubscribed
  stop_all_streams
end