-
public interface ActivityListA paginated list of activities that supports real-time updates and filtering.
ActivityListprovides a convenient way to fetch, paginate, and observe activities with automatic real-time updates via WebSocket events. It manages the state of activities and provides methods for loading more activities as needed.val query = ActivitiesQuery() val activityList = feedsClient.activityList(query) // Fetch initial activities matching the query val activities = activityList.get() // Load more activities if available if (activityList.state.canLoadMore) { val moreActivities = activityList.queryMoreActivities() } // Observe state changes activityList.state.activities.collect { activities -> println("Updated activities: ${activities.size}") }
-
-
Method Summary
Modifier and Type Method Description abstract Result<List<ActivityData>>get()Fetches the initial set of activities based on the current query configuration. abstract Result<List<ActivityData>>queryMoreActivities(Integer limit)Fetches the next page of activities if available. abstract ActivitiesQuerygetQuery()The query configuration used for fetching activities. abstract ActivityListStategetState()An observable object representing the current state of the activity list. -
-
Method Detail
-
get
abstract Result<List<ActivityData>> get()
Fetches the initial set of activities based on the current query configuration.
This method retrieves the first page of activities using the filtering and sorting parameters defined in the query. The results are automatically stored in the state and can be observed through the state.activities property.
-
queryMoreActivities
abstract Result<List<ActivityData>> queryMoreActivities(Integer limit)
Fetches the next page of activities if available.
This method retrieves additional activities using the pagination cursor from the previous request. The new activities are automatically merged with the existing activities in the state, maintaining the proper sort order.
- Parameters:
limit- Optional limit for the number of activities to fetch.
-
getQuery
abstract ActivitiesQuery getQuery()
The query configuration used for fetching activities.
This property contains the filtering, sorting, and pagination parameters that define how activities should be fetched and displayed.
-
getState
abstract ActivityListState getState()
An observable object representing the current state of the activity list.
-
-
-
-