serandel
07/05/2022, 7:35 AMDispatcher.Main
in Compose for Desktop? Or should I just depend on kotlinx-coroutines-android
?serandel
07/05/2022, 7:39 AMserandel
07/05/2022, 7:39 AMException in thread "AWT-EventQueue-0" java.lang.IllegalStateException: Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'
serandel
07/05/2022, 7:40 AMcomposeVersion=1.1.1
coroutinesVersion=1.6.1
javaVersion=17
kotlinVersion=1.6.10
ephemient
07/05/2022, 7:40 AMserandel
07/05/2022, 7:41 AMserandel
07/05/2022, 7:43 AMserandel
07/05/2022, 7:44 AM@Composable
fun App(stateFlow: StateFlow<MyState>) {
val state: MyState by stateFlow.collectAsState(context = Dispatchers.Main)
RenderUI(state)
}
serandel
07/05/2022, 7:44 AMRenderUI
is also a @Composable
serandel
07/05/2022, 7:45 AMserandel
07/05/2022, 7:45 AMephemient
07/05/2022, 7:47 AMserandel
07/05/2022, 7:48 AMserandel
07/05/2022, 7:48 AMephemient
07/05/2022, 7:49 AMserandel
07/05/2022, 7:51 AMAdam Brown
07/05/2022, 6:36 PMephemient
07/05/2022, 6:49 PMdelay
to work in kotlinx.coroutines 1.6.0, unless you set -Dkotlinx.coroutines.main.delay=false
(but it looks like they rolled that back in 1.6.1)orangy
MainUIDispatcher
in org.jetbrains.skiko
packageephemient
07/05/2022, 11:37 PMephemient
07/05/2022, 11:38 PMkotlinx-coroutines-swing
, it's being avoided in the libraries to prevent conflicts?