Travis Griggs
10/04/2023, 10:26 PMfun forEach(closure: (ValveSpan) -> Unit) {
series.forEach(closure)
}
If I use this in a @Composable function and try to do a @Composition (Text) inside of the closure, the compose compiler won't do it (@Composable invocations can only happen from the context of a @Composable function). Using the stock forEach on normal collections is fine. Do I need to declare my custom forEach with some kind of annoation for compose to be happy using it?Zach Klippenstein (he/him) [MOD]
10/04/2023, 10:48 PMsuspend
functions from a forEach
on eager collections in a suspending contextTravis Griggs
10/04/2023, 10:49 PMZach Klippenstein (he/him) [MOD]
10/04/2023, 10:50 PMinline
literally means it inlines the function body into the call site. So if the call site couldn’t access a private var, an inline function can’t@PublishedApi internal
Travis Griggs
10/04/2023, 10:56 PM