Package 

Interface FollowList


  • 
    public interface FollowList
    
                        

    A class that manages a paginated list of feed members.

    FollowList provides functionality to query and paginate through follows. It maintains the current state of the follow list and provides methods to load more follows when available.

    // Create a follow list with a specific query
    val query = FollowsQuery()
    val followList = feedsClient.followList(query)
    
    // Fetch initial follows matching the query
    val follows = followList.get()
    
    // Load more follows if available
    if (followList.state.canLoadMore) {
        val moreFollows = followList.queryMoreFollows()
    }
    
    // Observe state changes
    followList.state.follows.collect { follows ->
        println("Updated follows: ${follows.size}")
    }
    • Method Summary

      Modifier and Type Method Description
      abstract Result<List<FollowData>> get() Fetches the initial list of follows based on the current query configuration.
      abstract Result<List<FollowData>> queryMoreFollows(Integer limit) Loads the next page of follows if more are available.
      abstract FollowsQuery getQuery() The query configuration used to fetch follows.
      abstract FollowListState getState() An observable object representing the current state of the follow 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<FollowData>> get()

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

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

      • queryMoreFollows

         abstract Result<List<FollowData>> queryMoreFollows(Integer limit)

        Loads the next page of follows if more are available.

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

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

         abstract FollowsQuery getQuery()

        The query configuration used to fetch follows.

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

      • getState

         abstract FollowListState getState()

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

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