mediasfu-reactnative-expo
Version:
mediasfu-reactnative-expo – Expo-managed React Native WebRTC SDK for video conferencing, webinars, live streaming, broadcast, screen sharing, whiteboard, chat, recording, live subtitles, translation, and AI agent rooms on iOS, Android, and web. Prebuilt r
26 lines • 1.06 kB
JavaScript
import { receiveRoomMessages as sharedReceiveRoomMessages } from 'mediasfu-shared';
/**
* Retrieves messages from a specified room and updates the message state.
*
* @param {ReceiveRoomMessagesOptions} options - The options for receiving room messages.
* @param {Socket} options.socket - The socket instance used for communication.
* @param {string} options.roomName - The name of the room from which to retrieve messages.
* @param {Function} options.updateMessages - Function to update the state with retrieved messages.
*
* @returns {Promise<void>} A promise that resolves when the messages have been retrieved and updated.
*
* @throws Will log an error message if there is an issue retrieving the messages.
*
* @example
* ```typescript
* await receiveRoomMessages({
* socket: socketInstance,
* roomName: 'Room1',
* updateMessages: (messages) => console.log(messages),
* });
* ```
*/
export const receiveRoomMessages = async (options) => {
await sharedReceiveRoomMessages(options);
};
//# sourceMappingURL=receiveRoomMessages.js.map