beginExternalControl
Deprecated
Use externalState()?.beginControl(), which exists only when the store grants outside state.
Replace with
externalState()?.beginControl()Content copied to clipboard
Puts the store under external control, making a remote publisher the author of its state.
Every subsequently dispatched action that is not ExternalControlExempt is dropped and reported as DispatchResult.Blocked, so the only way state changes is applyExternalStates. Each ModuleLogic is notified through ModuleLogic.onExternalControlChanged before the gate engages, giving logic a chance to settle in-flight work while dispatch still works.
Must not be called from within action processing. The notification hook dispatches, and the dispatch loop is a single consumer, so calling this from a middleware or a reducer deadlocks.
Example usage:
storeAccessor.asInternalOperations()?.beginExternalControl()Content copied to clipboard