ThreadListController

class ThreadListController(query: QueryThreadsRequest, chatClient: ChatClient = ChatClient.instance(), scope: CoroutineScope = chatClient.inheritScope { DispatcherProvider.IO }, queryThreadsAsState: () -> StateFlow<QueryThreadsState?> = { chatClient.queryThreadsAsState( request = query, coroutineScope = scope, ) })

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.

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.

Constructors

Link copied to clipboard
constructor(query: QueryThreadsRequest, chatClient: ChatClient = ChatClient.instance(), scope: CoroutineScope = chatClient.inheritScope { DispatcherProvider.IO }, queryThreadsAsState: () -> StateFlow<QueryThreadsState?> = { chatClient.queryThreadsAsState( request = query, coroutineScope = scope, ) })

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
val state: StateFlow<ThreadListState>

Functions

Link copied to clipboard
fun load()

Force loads the first page of threads.

Link copied to clipboard

Loads the next page of threads (if possible).