-
public interface CommentListA class representing a paginated list of comments for a specific query.
This interface provides methods to fetch and manage comments, including pagination support and real-time updates through WebSocket events. It maintains an observable state that automatically updates when comment-related events are received.
val query = CommentsQuery() val commentList = feedsClient.commentList(query) // Fetch initial comment matching the query val comments = commentList.get() // Load more comments if available if (commentList.state.canLoadMore) { val moreComments = commentList.queryMoreComments() } // Observe state changes commentList.state.comments.collect { comments -> println("Updated comments: ${comments.size}") }
-
-
Method Summary
Modifier and Type Method Description abstract Result<List<CommentData>>get()Fetches the first page comments based on the query. abstract Result<List<CommentData>>queryMoreComments(Integer limit)Fetches the next page of comments based on the current state. abstract CommentsQuerygetQuery()The query used to fetch the comments. abstract CommentListStategetState()An observable object representing the current state of the comment list. -
-
Method Detail
-
get
abstract Result<List<CommentData>> get()
Fetches the first page comments based on the query.
-
queryMoreComments
abstract Result<List<CommentData>> queryMoreComments(Integer limit)
Fetches the next page of comments based on the current state.
- Parameters:
limit- Optional limit for the number of comments to fetch.
-
getQuery
abstract CommentsQuery getQuery()
The query used to fetch the comments.
-
getState
abstract CommentListState getState()
An observable object representing the current state of the comment list.
-
-
-
-