withState
Obtain the current state and operate on it without changing the state.
This function does NOT update the state, for that, use updateState.
This function will suspend until all previous withState or updateState invocations are finished if StoreConfiguration.atomicStateUpdates is enabled
If you want to operate on a state of particular subtype, use the typed version of this function.
If you wish to ignore plugins and thread-safety of state updates in favor of greater performance, see updateStateImmediate
This function is reentrant, which means, if you call:
withState {
withState { }
}
Content copied to clipboard
you will not get a deadlock.