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)
}
Colton Idle
01/04/2021, 7:28 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 idealColton Idle
01/05/2021, 4:44 AMAdam Powell
01/05/2021, 4:45 AMColton Idle
01/05/2021, 4:46 AMAdam Powell
01/05/2021, 5:31 AM