Colton Idle
01/04/2021, 5:41 PMAdam Powell
01/04/2021, 7:18 PMmodel.getItems()!!.observe(viewLifecycleOwner, {
setContent {
ComposeTrialScreen(response = it)
}
})
to be:
val items = model.getItems() ?: error("items missing")
setContent {
ComposeTrialScreen(items.observeAsState().value)
}
Adam Powell
01/04/2021, 7:19 PMColton Idle
01/04/2021, 7:28 PMColton Idle
01/04/2021, 9:47 PMerror("items missing")
a popular way to go about this? First time I've seen that. 😃
2. Just noticed that scrolling up and down loses my expand/collapsed items. So in this case... I want to "hoist" the state up into my VM most likely?Adam Powell
01/04/2021, 9:51 PM!!.
null-assertion to give it a better error message; removing the nullability there entirely would probably be idealAdam Powell
01/04/2021, 9:52 PMColton Idle
01/05/2021, 4:44 AMAdam Powell
01/05/2021, 4:45 AMColton Idle
01/05/2021, 4:46 AMColton Idle
01/05/2021, 4:47 AMAdam Powell
01/05/2021, 5:31 AM