How to trace a message from a large number of dialogs using

  • 0
    Hello! I want to implement a chat page for my application. The logic will be as follows: when a user goes to the chat page, all his dialogs are displayed to him. After all dialogs are displayed by dialogId, I connect them all in sockets. My question is:
    how can I catch a message if someone writes me from my dialogues?

    1) I get the Id of all dialogs
    2) By these Id I connect to the rooms.
    3) How can I track if someone writes me a message from any of these dialogs?
    useEffect(() => {
        const dialogsId = => value.dialogId)
       	socket.emit('joinDialogs',  dialogsId);
      }, [dialogList]);

    socket.on('joinDialogs', (dialogsId) => {
    JavaScript Archer Soto, Jul 11, 2020

  • 0 Answers
Your Answer
To place the code, please use CodePen or similar tool. Thanks you!