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
33 lines • 1.3 kB
JavaScript
import { handleEndPoll as sharedHandleEndPoll } from 'mediasfu-shared';
/**
* Handles the end of a poll by emitting an "endPoll" event through the provided socket.
* Displays an alert based on the success or failure of the operation.
*
* @param {HandleEndPollOptions} options - The options for ending the poll.
* @param {string} options.pollId - The ID of the poll to end.
* @param {Socket} options.socket - The socket instance to emit the event.
* @param {Function} [options.showAlert] - Optional function to display alerts.
* @param {string} options.roomName - The name of the room where the poll is being conducted.
* @param {Function} options.updateIsPollModalVisible - Function to update the poll modal visibility.
*
* @example
* ```typescript
* handleEndPoll({
* pollId: "poll123",
* socket: socketInstance,
* showAlert: (message) => console.log(message),
* roomName: "roomA",
* updateIsPollModalVisible: (isVisible) => setIsPollModalVisible(isVisible),
* });
* ```
*/
export const handleEndPoll = async ({ pollId, socket, showAlert, roomName, updateIsPollModalVisible, }) => {
await sharedHandleEndPoll({
pollId,
socket,
showAlert,
roomName,
updateIsPollModalVisible,
});
};
//# sourceMappingURL=handleEndPoll.js.map