Package 

Interface ActivityReactionList


  • 
    public interface ActivityReactionList
    
                        

    A list of activity reactions that provides pagination, filtering, and real-time updates.

    This class manages a collection of reactions for a specific activity. It provides methods to fetch reactions with pagination support and automatically handles real-time updates when reactions are added or removed from the activity.

    val query = ActivityReactionsQuery(activityId = "activity-123")
    val reactionList = feedsClient.activityReactionList(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 ->
        println("Updated reactions: ${reactions.size}")
    }
    • Method Detail

      • get

         abstract Result<List<FeedsReactionData>> get()

        Fetches the initial page of activity reactions.

        This method retrieves the first page of reactions for the activity based on the query configuration. Results are automatically stored in the state and can be accessed through state.reactions.

      • queryMoreReactions

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

        Fetches the next page of activity reactions.

        This method retrieves additional reactions if more are available. The method uses the pagination cursor from the previous request to fetch the next page of results.

      • getQuery

         abstract ActivityReactionsQuery getQuery()

        The query configuration used to fetch activity reactions.

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

      • getState

         abstract ActivityReactionListState getState()

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

        This state object contains the current reactions, pagination information, and loading state. You can observe changes to this state to update your UI when reactions are added, removed, or when new pages are loaded.