Pablo
05/29/2024, 11:50 AMuistate
, it's recommended to store only the ID of a selected item in the uistate
instead of the full object. So... where should we put the logic that iterates and gets the full object from the array using the id? My first thought was to put it on the viewmodel
, but the viewmodel
is hoisted to upper composables and is not possible to access it on the composable that receives the uistate.vide
05/30/2024, 11:31 AMvide
05/30/2024, 11:31 AMvide
05/30/2024, 11:32 AMval selectedItem = derivedStateOf { allOfMyItems[selectedIndex] }
vide
05/30/2024, 11:33 AM