-
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>stateprivate final StateFlow<ConnectionState>connectionStateprivate final StateFlow<User>user
-
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 StateFlow<ConnectionState>getConnectionState()The state of our network connection - if we're online, connecting or offline. final StateFlow<User>getUser()The state of the currently logged in user. 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()
-
getConnectionState
final StateFlow<ConnectionState> getConnectionState()
The state of our network connection - if we're online, connecting or offline.
-
getUser
final StateFlow<User> getUser()
The state of the currently logged in user.
-
loadNextPage
final Unit loadNextPage()
Loads the next page of threads (if possible).
-
-
-
-