@alex009 We have upgraded moko to 0.12 and all the usages of postValue in the ViewModel are shown as errors. Whats the suggested workaround? How do we set values to the MutableLiveData? We have a huge codebase.
a
alex009
03/23/2022, 1:46 AM
postValue now is extension function. just add import for it. but this extension exists only for mobile targets (android, ios)
s
SK
03/23/2022, 1:47 AM
Should the viewmodels be moved to mobileMain? Our code is common for android/ios.
a
alex009
03/23/2022, 1:50 AM
no
s
SK
03/23/2022, 1:53 AM
Are you suggesting the ViewModels to be split between android and ios? And no more sharing code?
a
alex009
03/23/2022, 1:54 AM
no
just add import
dev.icerock.moko.mvvm.livedata.postValue
nothing more.
s
SK
03/23/2022, 1:56 AM
Ok and leave everything in commonMain. Let me try.
Great, it did compile successfully now. Thanks. Android Studio editor still thinks it's an error and can't find the extension. Is it because it's in commonMain? Anyway to resolve this?