DownloadPizza
01/27/2024, 11:22 PMLaunchedEffect(Unit) {
withContext(<http://Dispatchers.IO|Dispatchers.IO>) {
while (true) {
val (_, response) = Fuel.get("<http://127.0.0.1:8080/test.img>").response()
img = loadImageBitmap(response.body().toStream())
delay(RELOAD_DURATION)
}
}
}
Or are there better ways to run a webrequest in a loop on a delay in a coroutine? img is a by remember { mutableStateOf(...) }
xoangon
01/28/2024, 10:45 AMState
or MutableState
and read that from the Composable function.