2022-04-14 15:56:10 -04:00
|
|
|
let RoomChat = {
|
2022-04-20 18:03:17 -04:00
|
|
|
connect(socket, postId) {
|
2022-04-14 15:56:10 -04:00
|
|
|
let channel = socket.channel(`post:${postId}`)
|
|
|
|
channel.join()
|
2022-04-20 18:03:17 -04:00
|
|
|
.receive("ok", resp => { console.log("Joined successfully: ", resp) })
|
|
|
|
.receive("error", resp => { console.log("Unable to join: ", resp) })
|
|
|
|
return channel;
|
2022-04-14 15:56:10 -04:00
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
export default RoomChat;
|