https://kotlinlang.org logo
Title
h

hfhbd

09/14/2021, 11:24 AM
Hey, sorry for this (daily) question, but I don't find the root case: I want to use Swift Combine and Kotlin Coroutines in an iOS and Android app. I use `Flow`s in my view models and repos, but create the init data flow with device local daos, on iOS with a Combine publisher. I always use
Dispatcher.Main
when converting the Publisher to Flow and vice versa, (maybe even too much), but I am always getting
Flow invariant is violated:
		Emission from another coroutine is detected.
		Child of null, expected child of DispatchedCoroutine{Completed}@806156c8.
		FlowCollector is not thread-safe and concurrent emissions are prohibited.
		To mitigate this restriction please use 'channelFlow' builder instead of 'flow'
Sample project: