applyExternalStates

abstract suspend fun applyExternalStates(states: Map<String, ModuleState>)(source)

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

This method updates the store's state without dispatching actions or executing reducers. The states are applied atomically within the store's internal mutex lock to ensure thread safety.

Example usage:

val internalOps = storeAccessor.asInternalOperations()
internalOps?.applyExternalStates(mapOf(
"com.example.CounterState" to CounterState(value = 42),
"com.example.UserState" to UserState(name = "Alice")
))

Parameters

states

Map of state class qualified names to new state instances