Function receiveRoomMessages

  • Retrieves messages from a specified room and updates the message state.

    Parameters

    Returns Promise<void>

    A promise that resolves when the messages have been retrieved and updated.

    Will log an error message if there is an issue retrieving the messages.

    await receiveRoomMessages({
    socket: socketInstance,
    roomName: 'Room1',
    updateMessages: (messages) => console.log(messages),
    });