Created
February 12, 2019 13:54
-
-
Save wellingtoncosta/7f37306f8c77fd5cfaedec13df6cb43d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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