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