``` private val myState: MutableState<String> =...
# compose
k
Copy code
private val myState: MutableState<String> = mutableStateOf("test")

    val stateValue1: String by myState

    val stateValue2: String
        get() = myState.value
Access
stateValue1
and
stateValue2
field from Composable function. Both trigger recompose after state value changed?
It might be a stupid question. It's something like MutableState object detect Composable from thread local or something, and then recompose that?
s
Kind of that, yep. See
Snapshot.current
k
Oh yes. SnapshotThreadLocal.