Package 

Interface CommentReactionList


  • 
    public interface CommentReactionList
    
                        

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

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

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

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

    • Filtering: Supports filtering by reaction type, user ID, and creation date

    • Sorting: Configurable sorting options for reaction ordering

    • Observable State: Provides reactive state management for UI updates

    • Method Detail

      • get

         abstract Result<List<FeedsReactionData>> get()

        Fetches the initial set of reactions for the comment.

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

      • queryMoreReactions

         abstract Result<List<FeedsReactionData>> queryMoreReactions(Integer limit)

        Loads the next page of reactions if more are available.

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

        Parameters:
        limit - Optional limit for the number of reactions to fetch.
      • getQuery

         abstract CommentReactionsQuery getQuery()

        The query configuration used to fetch comment reactions.

        This contains the comment ID, filters, sorting options, and pagination parameters that define how reactions should be fetched and displayed.

      • getState

         abstract CommentReactionListState getState()

        An observable object representing the current state of the comment reaction list.

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