Class: Chat::MessagesChannel

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

Instance Method Summary collapse

Instance Method Details

#follow(data) ⇒ Object



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

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

#unsubscribedObject



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

def unsubscribed
  stop_all_streams
end