Package 

Interface MemberList


  • 
    public interface MemberList
    
                        

    A class that manages a paginated list of feed members.

    MemberList provides functionality to query and paginate through members of a specific feed. It maintains the current state of the member list and provides methods to load more members when available.

    // Create a member list with a specific query
    val query = MembersQuery(fid = FeedId("feed:123"))
    val memberList = feedsClient.memberList(query)
    
    // Fetch initial members matching the query
    val members = memberList.get()
    
    // Load more members if available
    if (memberList.state.canLoadMore) {
       val moreMembers = memberList.queryMoreMembers()
    }
    
    // Observe state changes
    memberList.state.members.collect { members ->
       println("Updated members: ${members.size}")
    }
    • Method Summary

      Modifier and Type Method Description
      abstract Result<List<FeedMemberData>> get() Fetches the initial list of members based on the current query configuration.
      abstract Result<List<FeedMemberData>> queryMoreMembers(Integer limit) Loads the next page of members if more are available.
      abstract MembersQuery getQuery() The query configuration used to fetch members.
      abstract MemberListState getState() An observable object representing the current state of the member list.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • get

         abstract Result<List<FeedMemberData>> get()

        Fetches the initial list of members based on the current query configuration.

        This method loads the first page of members according to the query's filters, sorting, and limit parameters. The results are stored in the state and can be accessed through the state.members property.

      • queryMoreMembers

         abstract Result<List<FeedMemberData>> queryMoreMembers(Integer limit)

        Loads the next page of members if more are available.

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

        Parameters:
        limit - Optional limit for the number of members to return.
      • getQuery

         abstract MembersQuery getQuery()

        The query configuration used to fetch members.

        This contains the feed ID, filters, sorting options, and pagination parameters that define which members are retrieved and how they are ordered.

      • getState

         abstract MemberListState getState()

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

        This property provides access to the current members, pagination state, and other state information. The state is automatically updated when new members are loaded or when real-time updates are received.