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
32 lines • 1.38 kB
JavaScript
import { handleCreatePoll as sharedHandleCreatePoll } from 'mediasfu-shared';
/**
* Handles the creation of a poll by emitting a "createPoll" event with the provided details.
*
* @param {HandleCreatePollOptions} options - The options for creating the poll.
* @param {NewPoll} options.poll - The poll object containing the poll question, type, and options.
* @param {Socket} options.socket - The socket instance used to communicate with the server.
* @param {string} options.roomName - The name of the room where the poll is created.
* @param {Function} [options.showAlert] - Optional function to show alert messages.
* @param {Function} options.updateIsPollModalVisible - Function to toggle the poll modal visibility.
*
* @example
* ```typescript
* handleCreatePoll({
* poll: { question: "Favorite color?", type: "singleChoice", options: ["Red", "Blue", "Green"] },
* socket: socketInstance,
* roomName: "roomA",
* showAlert: (message) => console.log(message),
* updateIsPollModalVisible: (isVisible) => setIsPollModalVisible(isVisible),
* });
* ```
*/
export const handleCreatePoll = async ({ poll, socket, roomName, showAlert, updateIsPollModalVisible, }) => {
await sharedHandleCreatePoll({
poll,
socket,
roomName,
showAlert,
updateIsPollModalVisible,
});
};
//# sourceMappingURL=handleCreatePoll.js.map