Updates the poll state based on the provided data.
The options for updating the poll.
The data containing poll information.
The current list of polls.
The current poll.
The member identifier.
The level of the member.
Function to show alerts.
Function to update the list of polls.
Function to update the current poll.
Function to update the visibility of the poll modal.
A promise that resolves when the poll update is complete.
const pollUpdatedService = new PollUpdated();pollUpdatedService.pollUpdated({ data: { polls: [], poll: { id: '123', question: 'Sample Poll?', status: 'started' } }, polls: [], poll: { id: '123', question: 'Sample Poll?', status: 'started' }, member: 'user1', islevel: '1', showAlert: (alert) => console.log(alert.message), updatePolls: (polls) => console.log('Updated polls:', polls), updatePoll: (poll) => console.log('Updated poll:', poll), updateIsPollModalVisible: (visible) => console.log('Poll modal visibility:', visible),}); Copy
const pollUpdatedService = new PollUpdated();pollUpdatedService.pollUpdated({ data: { polls: [], poll: { id: '123', question: 'Sample Poll?', status: 'started' } }, polls: [], poll: { id: '123', question: 'Sample Poll?', status: 'started' }, member: 'user1', islevel: '1', showAlert: (alert) => console.log(alert.message), updatePolls: (polls) => console.log('Updated polls:', polls), updatePoll: (poll) => console.log('Updated poll:', poll), updateIsPollModalVisible: (visible) => console.log('Poll modal visibility:', visible),});
Updates the poll state based on the provided data.
Param: options
The options for updating the poll.
Param: options.data
The data containing poll information.
Param: options.polls
The current list of polls.
Param: options.poll
The current poll.
Param: options.member
The member identifier.
Param: options.islevel
The level of the member.
Param: options.showAlert
Function to show alerts.
Param: options.updatePolls
Function to update the list of polls.
Param: options.updatePoll
Function to update the current poll.
Param: options.updateIsPollModalVisible
Function to update the visibility of the poll modal.
Returns
A promise that resolves when the poll update is complete.
Example