-
public interface PollVoteListA list of poll votes that can be queried and paginated.
This class provides a way to fetch and manage a collection of poll votes with support for filtering, sorting, and pagination. It maintains an observable state that can be used in UI components.
// Create a poll vote list with a specific query val query = PollVotesQuery(pollId = "poll-123") val pollVoteList = feedsClient.pollVoteList(query) // Fetch initial poll votes matching the query val pollVotes = pollVoteList.get() // Load more poll votes if available if (pollVoteList.state.canLoadMore) { val morePollVotes = pollVoteList.queryMorePollVotes() } // Observe state changes pollVoteList.state.votes.collect { votes -> println("Updated poll votes: ${votes.size}") }
-
-
Method Summary
Modifier and Type Method Description abstract Result<List<PollVoteData>>get()Fetches the initial list of poll votes based on the current query. abstract Result<List<PollVoteData>>queryMorePollVotes(Integer limit)Loads more poll votes using the next page token from the previous query. abstract PollVotesQuerygetQuery()The query used to fetch the poll votes. abstract PollVoteListStategetState()An observable object representing the current state of the poll vote list. -
-
Method Detail
-
get
abstract Result<List<PollVoteData>> get()
Fetches the initial list of poll votes based on the current query.
This method retrieves the first page of poll votes matching the query criteria. The results are automatically stored in the state and can be accessed via the state.votes property.
-
queryMorePollVotes
abstract Result<List<PollVoteData>> queryMorePollVotes(Integer limit)
Loads more poll votes using the next page token from the previous query.
This method fetches additional poll votes if there are more available based on the current query. The new poll votes are automatically merged with the existing ones in the state.
- Parameters:
limit- The maximum number of poll votes to fetch.
-
getQuery
abstract PollVotesQuery getQuery()
The query used to fetch the poll votes.
-
getState
abstract PollVoteListState getState()
An observable object representing the current state of the poll vote list.
-
-
-
-