I am using Preferences DataStore and a `LaunchedEf...
# compose
r
I am using Preferences DataStore and a
LaunchedEffect
in my top-level composable to read in app preferences. I have hardcoded defaults for the preferences so that my UI can initially compose. When the stored preferences are loaded, the UI recomposes to match them. This happens quickly, but it's noticeable. I was hoping there was a way to skip right to the stored preferences based composition, i.e., delaying startup composition until the preferences are loaded.
a
you can do something like
Copy code
if (preferences != null) {
  Content(preferences)
}
and show nothing/a loading state at a higher level
r
That works -- thanks.