is there any possible way to manage viewmodel for ...
# multiplatform
s
is there any possible way to manage viewmodel for both platform [ios and android] KMM
d
a
There's a thread about it
c
They way I do it is I have a the VM written in common code. Then I inject this VM into an Android shim.
d
Another way is to
expect
a
PlatformViewModel
base-class. Then do
actual typealias = ViewModel
for the Android one, and just make up a stub for iOS. Removes the need for any composition.
k
There’s also this library that’s been referenced a lot in slack https://github.com/rickclephas/KMM-ViewModel
s
Well Personally i suggest using this vm https://github.com/icerockdev/moko-mvvm