Types

Link copied to clipboard
object Companion

Properties

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
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>)

Applies external state updates directly to the store, bypassing the action/reducer/logic pipeline.

Link copied to clipboard

Provides access to internal store operations for specialized use cases.

Link copied to clipboard
fun cleanup()
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 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>?

Returns the StateFlow for the given module's state, or null if the module is not registered in this store.

Link copied to clipboard
suspend fun hasPersistedState(): Boolean
Link copied to clipboard
suspend fun loadState()
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 the store by cancelling all child coroutines and restarting action processing.

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

Non-suspend convenience function that resets the store asynchronously.

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>