Is there a way to observe a _`State`_ property fro...
# multiplatform
h
Is there a way to observe a
State
property from another property? Let's say I
var firstName by mutableStateOf("")
and would like to make another property depend on its state being at the same time also a state. This means I'd like to observe its changes and handle them accordingly. Same way as composables know when something changes.
k
This is better asked in #compose for future reference, but you'll want to use
derivedStateOf
for this
1
h
Oh, you're right. I should have asked it there, sorry 😇 I didn't expect it to be that easy 🤯
k
No problem! Happy to help.