Is there any practical difference between these tw...
# compose
m
Is there any practical difference between these two fields ?
Copy code
class State{
    private val internalState = mutableStateOf(0f)
    
    val state: Float by internalState
    
    val state2: Float
        get() = internalState.value
}
also, if i want to have a state3 that is not ‘observable’. Meaning, it won’t trigger recomposition when read. A function returning it would do it?
Copy code
fun state3() = internalState.value
e
no, there is no practical difference
no, that will not do it
m
so there is no way to read the value without triggering recomposition ?
a
There's
Snapshot.withoutReadObservation { ... }
.
c
What do you want to achieve? Maybe you don’t even need to store your data in a state, so you don’t have to worry about such low level apis
m
i want to achieve exactly what i asked. Thanks @Albert Chang 😛