Hi :slightly_smiling_face: I'm trying to execute t...
# coroutines
m
Hi 🙂 I'm trying to execute two network requests in parallel and update the UI when I receive the responses. When I have received both response I want to update the UI to not be in a loading state. Atm I have something similar to this:
Copy code
private fun fetchImagesAndSpaces() = launch(UI) {
    isLoading.value = true
    val deferredSpaces = bg { GetSpaces() }
    val deferredImages = bg { GetImages() }
    spaces.value = deferredSpaces.await()
    images.value = deferredImages.await()
    isLoading.value = false
}
This is executed sequentially. Which I don't want