-
public final class PollOptionVotesViewControllerController responsible for managing the state and events related to poll option votes.
This controller handles fetching votes for a specific poll option from the API with pagination support. It automatically loads the first page on initialization and supports loading additional pages when PollOptionVotesViewAction.LoadMoreRequested is triggered. The controller emits state updates and error events for the UI to react to.
-
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<PollOptionVotesViewState>stateprivate final SharedFlow<PollOptionVotesViewEvent>events
-
Constructor Summary
Constructors Constructor Description PollOptionVotesViewController(Poll poll, Option option, ChatClient chatClient, CoroutineScope scope)
-
Method Summary
Modifier and Type Method Description final StateFlow<PollOptionVotesViewState>getState()The current state of the poll option votes view. final SharedFlow<PollOptionVotesViewEvent>getEvents()One shot events triggered by the controller. final UnitonViewAction(PollOptionVotesViewAction action)Handles an PollOptionVotesViewAction coming from the View layer. -
-
Constructor Detail
-
PollOptionVotesViewController
PollOptionVotesViewController(Poll poll, Option option, ChatClient chatClient, CoroutineScope scope)
- Parameters:
poll- The poll containing the option for which votes are displayed.option- The specific poll option for which vote results are fetched.chatClient- The ChatClient instance used for querying poll votes from the API.scope- The CoroutineScope used for launching coroutines.
-
-
Method Detail
-
getState
final StateFlow<PollOptionVotesViewState> getState()
The current state of the poll option votes view.
-
getEvents
final SharedFlow<PollOptionVotesViewEvent> getEvents()
One shot events triggered by the controller.
-
onViewAction
final Unit onViewAction(PollOptionVotesViewAction action)
Handles an PollOptionVotesViewAction coming from the View layer.
-
-
-
-