I have a `data class` , and i created a mutableSta...
# compose
j
I have a
data class
, and i created a mutableStateOf<MyClass>(). What is the best way to update this data class with mutable state on ViewModel? • Set value directly:
myClass.property = "value"
• Or use copy function:
myClass.copy(property = "value")
m
option1 won’t work, since the property is not observable. option2 should be fine
1
I think you should prefer to expose Flow<MyState>, instead of exposing compose types to viewmodels
j
I got. Thanks