droidcon-india / droidcon-india-app-2020

Apache License 2.0
2 stars 0 forks source link

Finalize base architecture for multiplatform #1

Open jitinsharma opened 4 years ago

jitinsharma commented 4 years ago

https://github.com/badoo/Reaktive https://github.com/joreilly/PeopleInSpace

iamBedant commented 4 years ago

https://github.com/touchlab/KaMPKit

jitinsharma commented 4 years ago

The PeopleInSpace is pretty simple, similar to what we did earlier. The Repository is in common module and ViewModel in android module which then plugs-in to Compose. We can use same pattern till ViewModel part and then decide whether to use compose or not.

KaMPKit looks more promising.

arkivanov commented 4 years ago

Another architecture variant is MVI-ish: https://github.com/badoo/Reaktive/tree/master/sample-mpp-module Apps just need to implement views and call binder lifecycle callbacks. View implementation means: to render a single view model data class and to produce simple view events. Everything else is shared in a common module.

iamBedant commented 4 years ago

@arkivanov I can see there is Rxjava2/3 interop available for JVM. Is there anything similar for RxSwift as well?

arkivanov commented 4 years ago

You normally don't need interop with any Rx framework, unless you already have it in your project. Plus you can avoid using Rx from the app sides at all (check the link above). But sometimes you do need to expose Rx from a shared module. In this case you can wrap streams as shown here. So from Android side you can use Reaktive directly. From iOS you will be able to subscribe (and dispose), if you need any operators then you can extend the wrappers with your own classes and add operator delegates there. Answering your question, there is no interop with RxSwift as of now.