Retrieves messages from a specified room and updates the message state.
The options for receiving room messages.
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),}); Copy
await receiveRoomMessages({ socket: socketInstance, roomName: 'Room1', updateMessages: (messages) => console.log(messages),});
Retrieves messages from a specified room and updates the message state.