I'm using Pusher for one-to-one real time messages between two people.
This is my code when you are in the "room"
Echo.private('chat.'+this.roomid)
.listen('MessageSent',(e)=>{
this.allMessages.push(e.message)
this.scrollBottom(this.messagesContainer);
});
My question is how should be the logic when you are outside every chat and you want to show a number of new messages to you next to a message icon in the navigation? Should it be a different event that is not tied to a chat "room" but rather just to a user?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…