Hi guys what do you use as a viewmodel in kmp proj...
# multiplatform
b
Hi guys what do you use as a viewmodel in kmp project in common like as android only has android viewmodel which is lifecycle aware but i am usnig compose mutlilatform which anyways dont have any relation to android or any platfor so should i use some library like KMM viewmodels and all or there us no need adn if there is no need that will my vm survive configuration changes ?
s
Configuration change or activity recreation concept is limited to android platform only as you said. Even though it's better to use or implement any ViewModel lib which support Kotlin Multiplatform. As it's just help us to architect our project code better and upon that KMP Viewmodel lib provides coroutine support as well. I believe KMM Viewmode or Moko-MVVM viewmodel support configuration change for android platform internally.
b
@Swapnil Musale okk thanks