Pablo
11/28/2025, 1:17 PMuiState, then I use LaunchedEffect to pass it up to the parent, which also stores it. That duplicates state and breaks Single Source of Truth.
Example of my parent section receiving the pdf and storing it in it's own uistate to do actions with it:
composable(InfractionsDestinations.Pending.name) {
PendingScreen(
infractions = uiState.pendingInfractions,
onPDFDisplayRequested = { pdf -> vm.storePDFForDisplayingItAndOtherActions(pdf) }
)
}
Child ViewModel:
data class UiState(val loading: Boolean = false, val pdf: PDF? = null)
Child Composable:
LaunchedEffect(uiState.pdf) {
uiState.pdf?.let { onPDFDisplayRequested(it) }
}
👉 Question: What’s the recommended Compose/MVVM strategy to avoid duplicating the PDF in both child and parent state, while still letting each child generate it?Guillaume B
11/28/2025, 4:02 PM