Hello, everyone! What is the best architectural ap...
# multiplatform
s
Hello, everyone! What is the best architectural approach for KMM? I am interested in the common ViewModel for Android and iOS. I see three main approaches right now: Redux-kotlin, Moko-mvvm and Decompose. Which of these is the best tool to choose for a project from scratch or is there something else?
k
Couple more options to throw out there, specifically compose runtime driven • https://github.com/rjrjr/TTThttps://github.com/slackhq/circuithttps://github.com/cashapp/redwood (droidcon talk)
s
MVVM is working well for me, not using Moko but a very very similar approach. My advice is to use that but to be very strict with your architecture
a
There’s a custom VM here which I found useful. It uses platform specific VM scopes: https://github.com/touchlab/KaMPKit
c
We use a custom VM, but have made some adaptions so that we are not exposing duplicate state collection logic for iOS/Android. I wrote a blog about it -> https://medium.com/@ciaran_59881/kmm-think-smarter-when-sharing-state-2bfef11f00da, feel free to check it out 🙂