StateRegistry

class StateRegistry(userStateFlow: StateFlow<User?>, latestUsers: StateFlow<Map<String, User>>, job: Job, scope: CoroutineScope)

Registry of all state objects exposed in the offline plugin. This class should have only one instance for the SDK.

Parameters

userStateFlow

The state flow that provides the user once it is set.

latestUsers

Latest users of the SDK.

job

A background job cancelled after calling clear.

scope

A scope for new coroutines.

Constructors

Link copied to clipboard
constructor(userStateFlow: StateFlow<User?>, latestUsers: StateFlow<Map<String, User>>, job: Job, scope: CoroutineScope)

Functions

Link copied to clipboard
fun channel(channelType: String, channelId: String): ChannelState

Returns ChannelState that represents a state of particular channel.

Link copied to clipboard
fun clear()

Clear state of all state objects.

Link copied to clipboard

Returns QueryChannelsState associated with particular filter and sort.

Link copied to clipboard
fun thread(messageId: String): ThreadState

Returns ThreadState of thread replies with parent message that has id equal to messageId.