https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
a

Alberto

09/16/2020, 2:24 PM
are there any recommendations on a Observer / RX multiplatform library targeting Android / iOS? I saw https://github.com/noheltcj/RxCommon but not sure how up to date is. Also not necessarily looking for RX specifically, but a framework perhaps already available to deal with observables on Android / iOS.
Also this library seems providing LiveData functionality on Android https://github.com/florent37/Multiplatform-LiveData - just wondering if there's any recommendations out there
k

Kurt Renzo Acosta

09/16/2020, 3:16 PM
a

Alberto

09/16/2020, 3:39 PM
Nice seems one of the most complete frameworks. Just wanted to avoid picking one that was no longer supported. It would give more confidence knowing for example what larger companies are doing. (like maintaining their owns, vs depending on one of these)
Are there any recommendations for example from folks from TouchLab? @russhwolf
e

Erik Christensen

09/16/2020, 4:15 PM
Coroutines are probably the way to go unless you have a good reason to not use them. Take a look at
Flow
.
☝️ 2
a

Alberto

09/16/2020, 4:16 PM
Are they working well on iOS too?
👌 2
e

Erik Christensen

09/16/2020, 4:18 PM
They work. There are still some quirks and you likely will need to use the native-mt branch, but the future-proof solution for sure.
👍 1
a

Alberto

09/16/2020, 5:35 PM
are kotlinx.coroutines available only on that specific branch? I'm getting Unresolved reference: coroutines when tryng to import them in common shared code (using Kotlin 1.3.70 and Kotlinx Coroutines 1.3.5)
k

kpgalligan

09/16/2020, 6:00 PM
We’ve moved onto 1.4.0 in general. You can see the changes to the dependencies that we’ve been using here: https://github.com/touchlab/KaMPKit/commit/06701c1b4c0a425b3f8acf1d55c0ff0c2aa7f5b4#diff-f6dcd12435c476b2cedd79bcd292b929
a

Alberto

09/16/2020, 6:03 PM
got it, will try to do the same on my end. So would you also recommend using Kotlin Coroutines / flow for handling async and observers on multiplatform code?
what is the first available Kotlinx Coroutines version which provides functionality to the Common Shared code? Does it require 1.4.0?
k

kpgalligan

09/16/2020, 8:37 PM
First? For multiple threads, the first version was around November of last year, but I’m not sure what version that was. 1.4.0 is not necessarily required, but I would think that’s the simplest option.
a

Alberto

09/16/2020, 8:40 PM
Got it, I'm getting Unresolved reference: coroutines when trying to import them in common shared code (while it compile fines for Android code) - using Kotlin 1.3.70 and Kotlinx Coroutines 1.3.5. So wasn't sure if they are not available for common shared code in the version I'm using, or if I've not set up correctly the dependencies in my build.gradle. Unfortunately upgrading to 1.4.0 is a pain in the system I'm currently on, so wanted to know if it was required.
4 Views