-
public interface ActivityListStateAn observable state object that manages the activities list and handles real-time updates.
ActivityListState provides a reactive interface for observing changes to the activities list, including pagination state and real-time updates from WebSocket events. It automatically handles sorting, merging, and updating activities as they change.
Example usage:
val activityList = client.activityList(query) activityList.state.activities.collectLatest { activities -> // Update UI with new activities }
-
-
Method Summary
Modifier and Type Method Description abstract ActivitiesQuerygetQuery()The query configuration used for fetching activities. abstract StateFlow<List<ActivityData>>getActivities()All the paginated activities in the current list. abstract PaginationDatagetPagination()Last pagination information from the most recent request. BooleangetCanLoadMore()-
-
Method Detail
-
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.
-
getActivities
abstract StateFlow<List<ActivityData>> getActivities()
All the paginated activities in the current list.
This property contains all activities that have been fetched and merged, maintaining the proper sort order. It automatically updates when new activities are loaded, when real-time events occur, or when activities are modified.
-
getPagination
abstract PaginationData getPagination()
Last pagination information from the most recent request.
This property contains the pagination cursors and metadata from the last successful request. It is used to determine if more activities can be loaded and to construct subsequent pagination requests.
-
getCanLoadMore
Boolean getCanLoadMore()
-
-
-
-