ankushg
11/16/2020, 7:59 PMinterface
from Kotlin which declares `suspend fun`s (or some other async construct), and have an iOS app app directly implement the interface in Swift, rather than implementing it through KMP?
Our mobile data layers are currently platform-specific and have a ton of moving parts. It's definitely not a short-term project to convert them to KMP (and we're not sure if we would ever really want to).
We do however want to migrate more logic into KMP! We were hoping there's a way to:
• define KMP interfaces for Use Cases/Interactors,
• implement those interfaces using our (non-KMP) data layers in iOS/Android, and then
• constructor-inject those Use Case implementations into a KMP ViewModel, using them from common code
Anyone have any insight?Sebastien Leclerc Lavallee
11/17/2020, 4:04 AMAnalytics
class (KMP) that receive as a construct an instance of an AnalyticsExecutor
interface that is implemented in iOS and Android.
A “foreseable” downside, the constructor-injected must be done within each platform.ankushg
11/17/2020, 5:22 AMsuspend fun getUser(id: String): User
in it, or are you limited to just Unit
-returning blocks that log analytic events given a payload?Sebastien Leclerc Lavallee
11/17/2020, 5:35 AMBig Chungus
11/17/2020, 7:03 AMFerran
11/17/2020, 9:50 AMlouiscad
11/17/2020, 9:56 AMFerran
11/17/2020, 9:56 AMlouiscad
11/17/2020, 9:57 AMFerran
11/17/2020, 9:58 AMankushg
11/17/2020, 11:23 AMlouiscad
11/17/2020, 12:03 PM