David Herman
12/06/2022, 12:45 AMDavid Herman
12/06/2022, 12:45 AMDavid Herman
12/06/2022, 12:50 AMsealed interface Justification {
object Left : Justification
object Center: Justification
object Right: Justification
}
@Composable
fun SpanText(text: String, just: Justification) {
println("SpanText recomposed")
// Use justification etc.
Span { Text(text) }
}
If Justification
is defined in the app module itself, it's fine. But if included from a library module, the println will get triggered every time.David Herman
12/06/2022, 12:53 AM@Immutable
then the recompositions stop happening. But I shouldn't have to do that.agrosner
12/06/2022, 3:05 AMDavid Herman
12/06/2022, 3:11 AMDavid Herman
12/06/2022, 3:11 AMDavid Herman
12/06/2022, 3:11 AMDavid Herman
12/06/2022, 6:29 AM:app:jsBrowserRun
to see it in action.Oleksandr Karpovich [JB]
12/06/2022, 9:48 AMDavid Herman
12/06/2022, 4:29 PMOleksandr Karpovich [JB]
12/07/2022, 5:37 PMDavid Herman
12/07/2022, 5:40 PMOleksandr Karpovich [JB]
12/07/2022, 5:44 PMJusitification
as a parameter in the lib (so IR in your klib will be optimal)
But of course when users take your lib and have their own functions with Justification
as a parameter, they won’t have those optimizations unless they apply 1.3.2.2-beta01 too.David Herman
12/07/2022, 5:44 PMDavid Herman
12/07/2022, 5:44 PMDavid Herman
12/07/2022, 5:46 PMOleksandr Karpovich [JB]
12/07/2022, 5:48 PMDavid Herman
12/07/2022, 5:49 PMDavid Herman
12/07/2022, 5:49 PMOleksandr Karpovich [JB]
12/07/2022, 5:51 PMDavid Herman
12/07/2022, 5:51 PMDavid Herman
12/15/2022, 7:40 PMDavid Herman
12/15/2022, 7:51 PMOleksandr Karpovich [JB]
12/16/2022, 9:54 AM