awaitState

suspend fun awaitState(): S

Calling this function suspends until all pending setState reducers are run and then returns the latest state. As a result, it is safe to call setState { } and assume that the result from a subsequent awaitState() call will have that state.