What’s the right way to hold a coroutine until a l...
# coroutines
j
What’s the right way to hold a coroutine until a listener is called? I.e. something like:
Copy code
fun suspend getCar(): Car {
    val returnedCard
    fetcher.getCar({ car ->
       returnedCar = car 
    })
    // await while car is fetched ???
    return returnedCar
}
r
j
Thanks!