martmists
07/18/2023, 4:16 PM@Composable
fun SomePage() {
val body = remember { // Do I need to put this in remember to only call it once?
suspendedGetData() // This should only be called once per composition of SomePage
}
Text(body)
}
Casey Brooks
07/18/2023, 4:38 PMproduceState
to fetch the data
@Composable
fun SomePage() {
val body: Response? by produceState<Response?>(null) {
value = suspendedGetData()
}
Text(body)
}
Zach Klippenstein (he/him) [MOD]
07/18/2023, 7:12 PMmartmists
07/19/2023, 12:19 AMZach Klippenstein (he/him) [MOD]
07/19/2023, 7:59 PMmartmists
07/19/2023, 8:15 PM