Whats the correct way to check state property ensuring thread safety. For example
Copy code
data class MviState(val isChecked: Boolean)
Inside ViewModel ...
fun doSomething = intent {
if(mviState.isChecked) { --------------> how to ensure its thread safe here. (reduce block is thread safe)
postSideEffect(SideEffect.Something)
}
}
b
Benoît
01/21/2022, 1:39 PM
What do you mean thread safe? Reading a value is always thread safe. Writing isn't, but you're only reading here 🙂