Package 

Class ThreadListController


  • 
    public final class ThreadListController
    
                        

    Controller 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.

    • 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 Unit load() Force loads the first page of threads.
      final Unit loadNextPage() Loads the next page of threads (if possible).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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

      • 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.

      • load

         final Unit load()

        Force loads the first page of threads.

      • loadNextPage

         final Unit loadNextPage()

        Loads the next page of threads (if possible).