Travis Griggs
01/18/2024, 8:53 PM@Composable
@ReadOnlyComposable
internal fun resources(): Resources {
LocalConfiguration.current
return LocalContext.current.resources
}
I was surprised to see the first line of the function body there. It simple accesses LocalConfiguration.current, but does nothing with it? Why is this line there? If it's causing an undocumented state change side effect through a simple access, that seems to fly in the face of what Compose is about? And does that mean that the Kotlin compiler will never optimize that sort of thing away? (A C compiler would look at it and see, huh, didn't do anything with the result, skipping the whole thing, unless otherwise informed (e.g. volatile, etc))shikasd
01/18/2024, 9:14 PMshikasd
01/18/2024, 9:17 PMAlex Vanyo
01/18/2024, 11:59 PMTravis Griggs
01/19/2024, 6:48 PMAndy Himberger
01/27/2024, 9:26 PM* A composable function that returns the [Resources]. It will be recomposed when [Configuration]
* gets updated.