Package 

Interface ActivityCommentListState


  • 
    public interface ActivityCommentListState
    
                        

    An observable object representing the current state of an activity's comment list.

    This class manages the state of comments for a specific activity, including the list of comments, pagination information, and real-time updates from WebSocket events. It automatically handles comment additions, updates, deletions, and reaction changes.

    // Access the state from an ActivityCommentList
    val commentList = feedsClient.activityCommentList(query)
    val state = commentList.state
    
    // Observe comment changes
    state.comments.collect { comments ->
        // Update UI with new comments
    }
    
    // Check pagination status
    if (state.canLoadMore) {
        // Load more comments
    }
    
    // Access current comments
    val currentComments = state.comments.value
    • Observable State: Uses flow properties for reactive UI updates

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

    • Pagination Support: Tracks pagination state for loading more comments

    • Change Handlers: Internal handlers for processing WebSocket events

    • Method Detail

      • getComments

         abstract StateFlow<List<ThreadedCommentData>> getComments()

        All the paginated comments for the activity.

        This property contains the current list of comments, including any threaded replies based on the query configuration. The list is automatically updated when new comments are added, existing comments are updated or deleted, or when reactions are added or removed.

      • getPagination

         abstract PaginationData getPagination()

        Last pagination information from the most recent API response.

        This property contains the pagination cursors and metadata from the last successful API request. It's used to determine if more comments can be loaded and to construct subsequent pagination requests.