Join Slack
Powered by
Hi anyone is having example of LiveData used in S...
# multiplatform
n
Napa Ram
05/19/2021, 6:41 AM
Hi anyone is having example of LiveData used in Shared common code
a
alex009
05/19/2021, 6:45 AM
https://github.com/icerockdev/moko-mvvm/blob/master/sample/mpp-library/src/commonMain/kotlin/com/icerockdev/library/sample6/LoginViewModel.kt
n
Napa Ram
05/19/2021, 7:55 AM
Thanks
@alex009
j
John O'Reilly
05/19/2021, 8:12 AM
I think recommendation though would be to use StateFlow instead of LiveData in shared code (and in fact in general) if possible
👍 1
n
Napa Ram
05/19/2021, 8:14 AM
@John O'Reilly
yeah John i was going through your blog i think it better to use StateFlow
j
John O'Reilly
05/19/2021, 8:15 AM
btw, if you haven't seen it, there was nice article a few days ago about transitioning from LiveData to StateFlow etc
https://medium.com/androiddevelopers/migrating-from-livedata-to-kotlins-flow-379292f419fb
4
Views
Open in Slack
Previous
Next