Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

The installed DispatchInstrumentation, or null when none is installed or the installed one reports DispatchInstrumentation.isActive as false.

Link copied to clipboard
Link copied to clipboard
open override val dispatch: Dispatch

The dispatch function for sending actions to the store. This is fire-and-forget - it returns immediately without waiting for processing.

Link copied to clipboard
val initialized: StateFlow<Boolean>
Link copied to clipboard

true while a remote publisher authors this store's state.

Link copied to clipboard
open override val serializersModule: SerializersModule

Functions

Link copied to clipboard
open override fun addCrashListener(listener: CrashListener)

Registers a CrashListener to be notified when logic invocation throws.

Link copied to clipboard
open suspend override fun applyExternalStates(states: Map<String, ModuleState>)

Replaces the state of the named modules without running their reducers.

Link copied to clipboard

Provides access to internal store operations for specialized use cases.

Link copied to clipboard
open suspend override fun beginExternalControl()

Puts the store under external control, making a remote publisher the author of its state.

Link copied to clipboard
fun cleanup()
Link copied to clipboard
suspend fun close()
Link copied to clipboard
open suspend override fun dispatchAndAwait(action: ModuleAction): DispatchResult

Dispatch an action and wait for it to be processed. Returns a DispatchResult indicating whether the action was applied or blocked.

Link copied to clipboard
open suspend override fun endExternalControl()

Returns the store to local control, re-enabling the normal dispatch pipeline.

Link copied to clipboard
open override fun externalState(): ExternalStateAccess?
Link copied to clipboard
open override fun getAllStates(): Map<String, ModuleState>

A snapshot of every registered module's current state, keyed by the state class's qualified name.

Link copied to clipboard
open suspend override fun getLogicForModule(module: Module<*, *>): ModuleLogic?

Returns the logic instance for the given module, suspending until the store is fully initialized.

Link copied to clipboard
open override fun <M : Any> getModule(moduleClass: KClass<M>): M?

Get a module instance by its class.

inline fun <M : Any> getModule(): M?

Convenience reified overload for getModule.

Link copied to clipboard
open override fun getRegisteredModules(): List<Module<*, *>>

Returns all modules registered in this store.

Link copied to clipboard
open override fun getStateFlowForModule(module: Module<*, *>): StateFlow<ModuleState>?
Link copied to clipboard
suspend fun hasPersistedState(): Boolean
Link copied to clipboard
suspend fun loadState()
Link copied to clipboard
open override fun markExternallyDriven()

Engages the dispatch gate synchronously, before any logic has had a chance to run.

Link copied to clipboard
open override fun removeCrashListener(listener: CrashListener)

Removes a previously registered CrashListener.

Link copied to clipboard
open suspend override fun reset(): Boolean

Resets every module to its initial state and recreates every logic instance.

Link copied to clipboard
open override fun resetAsync(): Job

Launches reset on the store's root job and returns immediately.

Link copied to clipboard
suspend fun saveState(state: Map<String, ModuleState>)
Link copied to clipboard
inline suspend fun <L : ModuleLogic> selectLogic(): L

open suspend override fun <L : ModuleLogic> selectLogic(logicClass: KClass<L>): L

Select a module's logic instance by its class.

Link copied to clipboard
inline suspend fun <L : ModuleLogic> StoreAccessor.selectLogic(): L

Selects a module's logic instance by its type.

Link copied to clipboard
inline suspend fun <S : ModuleState> selectState(): StateFlow<S>

open suspend override fun <S : ModuleState> selectState(stateClass: KClass<S>): StateFlow<S>

Select a module's state flow by its class.

Link copied to clipboard
inline suspend fun <S : ModuleState> StoreAccessor.selectState(): StateFlow<S>

Selects a module's state flow by its type.

Link copied to clipboard
inline fun <S : ModuleState> selectStateNonSuspend(): StateFlow<S>
fun <S : ModuleState> selectStateNonSuspend(stateClass: KClass<S>): StateFlow<S>
Link copied to clipboard
open override fun setDispatchInstrumentation(instrumentation: DispatchInstrumentation?)

Installs the instrumentation that observes this store, or null to remove it.