Class HandleVotePoll

Handles the voting process for a poll.

The options for handling the vote.

The ID of the poll.

The index of the selected option.

The socket instance for communication.

Optional function to show alerts.

The member who is voting.

The name of the room where the poll is conducted.

Function to update the visibility of the poll modal.

A promise that resolves when the vote is handled.

Will log an error message if there is an issue submitting the vote.

const handleVotePollService = new HandleVotePoll();
await handleVotePollService.handleVotePoll({
pollId: '12345',
optionIndex: 1,
socket: socketInstance,
member: 'user1',
roomName: 'room1',
showAlert: ({ message, type }) => {
console.log(`Alert: ${message} - Type: ${type}`);
},
updateIsPollModalVisible: (isVisible) => {
console.log('Poll modal visibility:', isVisible);
},
});

Constructors

Methods

Constructors

Methods