-
public final class ThreadListControllerController responsible for managing the Threads list state. It serves as a central place for the state management and business logic related to the Threads list.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classThreadListController.Companion
-
Field Summary
Fields Modifier and Type Field Description private final StateFlow<ThreadListState>state
-
Constructor Summary
Constructors Constructor Description ThreadListController(QueryThreadsRequest query, ChatClient chatClient, CoroutineScope scope, Function0<StateFlow<QueryThreadsState>> queryThreadsAsState)
-
Method Summary
Modifier and Type Method Description final StateFlow<ThreadListState>getState()final Unitload()Force loads the first page of threads. final UnitloadNextPage()Loads the next page of threads (if possible). -
-
Constructor Detail
-
ThreadListController
ThreadListController(QueryThreadsRequest query, ChatClient chatClient, CoroutineScope scope, Function0<StateFlow<QueryThreadsState>> queryThreadsAsState)
- Parameters:
query- The QueryThreadsRequest object containing the parameters for querying threads.chatClient- The ChatClient instance for retrieving the Threads related data.scope- The CoroutineScope on which coroutines should be launched.queryThreadsAsState- Function that returns a StateFlow of QueryThreadsState.
-
-
Method Detail
-
getState
final StateFlow<ThreadListState> getState()
-
loadNextPage
final Unit loadNextPage()
Loads the next page of threads (if possible).
-
-
-
-