Aggiedit/assets/js/chat.js

11 lines
319 B
JavaScript
Raw Normal View History

2022-04-14 15:56:10 -04:00
let RoomChat = {
connect(socket, postId) {
2022-04-14 15:56:10 -04:00
let channel = socket.channel(`post:${postId}`)
channel.join()
.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;