I read coroutines dont work well, so network model...
# kotlin-native
u
I read coroutines dont work well, so network models maybe? But I need to switch to kotlin-serialization correct?
r
Depends on what you mean by “common with iOS”. As long as you don’t expose coroutines to Swift, they work well
We basically share the entire Model layer from the MVP model between apps, using data classes, ktor-client and kotlinx.serialization
Some also share the Presenter layer, which is a very good idea if you have actually identical views on different platforms
u
how do you share presenters that dont use any coroutines or rx? one of them is almost always present in my "components" in the domain, i.e. class that holds its own state, mutator methods and getters as observables
j
Its fairly easy to make an observable interface and provide abstractions around async work that is implemented on each platform
Observable is just a pattern, doesn't require RxJava
u
true but that either means ist the end of that chain, or reimplement (interfaces) operators
j
Yes, you may want to look at reaktive
u
They work with ios no problem?
j
I have only done basic analysis w/ the lib but it provides a subset of RxJava functionality and interop with similar interface. Might be worth looking into for your use case
Personally I've been trying to keep api surface between platforms as simple as possible and exposing only basic callbacks to platform via Presenter
I'm interested in different architectural patterns though. Try it out though, let us know experience. For science 🔬