Closed antranapp closed 2 years ago
hello!
our LiveData
have method ld()
for android. this method return androidx.lifecycle.LiveData
. so you can use
https://developer.android.com/reference/kotlin/androidx/compose/runtime/livedata/package-summary#(androidx.lifecycle.LiveData).observeAsState()
I'm learning KMM and Jetpack Compose simultaneously.
I was able to create a ViewModel using AndroidX Lifecycle, where I can expose a property as state to Jetpack Compose View by using
observeAsState
Now I want to move the ViewModel to common layer to share it with the iOS target, but I have no idea how I can expose the same property to Jetpack Compose again since
observeAsState
doesn't seem to be available.