Skip to content

Instantly share code, notes, and snippets.

@wellingtoncosta
Created February 12, 2019 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wellingtoncosta/7f37306f8c77fd5cfaedec13df6cb43d to your computer and use it in GitHub Desktop.
Save wellingtoncosta/7f37306f8c77fd5cfaedec13df6cb43d to your computer and use it in GitHub Desktop.
suspend fun loadUserData(username: String): User {
return coroutineScope {
val user = async { loadUser(username) }
val repos = async { loadRepos(username) }
buildUserData(user.await(), repos.await())
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment