You shouldn't need to return. You can use the `use...
# coroutines
k
You shouldn't need to return. You can use the
userInfo
directly from there
Copy code
fun retrieveUserInfo(userId: String) = launch(UI) {
  val userInfo = api.retrieveUserById(userId)
  // Use userInfo here
}
Or If you need to return, then you'll need to make the function a suspending one
Copy code
suspend fun retrieveUserInfo(userId: String) {
  val userInfo = api.retrieveUserById(userId)
  return userInfo
}