Package 

Interface CommentReplyList


  • 
    public interface CommentReplyList
    
                        

    A class representing a paginated list of replies for a specific comment.

    This class provides methods to fetch and manage replies to a comment, including pagination support and real-time updates through WebSocket events. It maintains an observable state that automatically updates when reply-related events are received.

    // Create a reply list for a comment
    val query = CommentRepliesQuery(commentId = "comment-123")
    val replyList = feedsClient.commentReplyList(query)
    
    // Fetch initial replies
    val replies = replyList.get()
    
    // Load more replies if available
    if (replyList.state.canLoadMore) {
        val moreReactions = replyList.queryMoreReplies()
    }
    
    // Observe state changes
    replyList.state.replies.collect { replies ->
        Log.d(TAG, "Updated replies: ${replies.size}")
    }
    • Pagination: Supports loading replies in pages with configurable limits

    • Real-time Updates: Automatically receives WebSocket events for reply changes

    • Threaded Replies: Supports nested reply structures with depth control

    • Reactions: Tracks reply reactions and updates in real-time

    • Observable State: Provides reactive state management for UI updates

    • Method Detail

      • get

         abstract Result<List<ThreadedCommentData>> get()

        Fetches the initial set of replies for the comment.

        This method retrieves the first page of replies based on the query configuration. The results are automatically stored in the state and can be accessed through the state.replies property.

      • queryMoreReplies

         abstract Result<List<ThreadedCommentData>> queryMoreReplies(Integer limit)

        Loads the next page of replies if more are available.

        This method fetches additional replies using the pagination information from the previous request. If no more replies are available, an empty array is returned.

        Parameters:
        limit - The maximum number of replies to fetch.
      • getState

         abstract CommentReplyListState getState()

        An observable object representing the current state of the reply list.

        This property provides access to the current replies, pagination information, and real-time updates. The state automatically updates when WebSocket events are received for reply additions, updates, deletions, and reactions.