Skip to content

Instantly share code, notes, and snippets.

@KhomDrake
Created March 7, 2022 02:34
Show Gist options
  • Save KhomDrake/1923f93fc9e6ec710444c07ab2c14895 to your computer and use it in GitHub Desktop.
Save KhomDrake/1923f93fc9e6ec710444c07ab2c14895 to your computer and use it in GitHub Desktop.
fun loadMovies() {
mainScope.launch {
val movies = withContext(Dispatchers.IO) { // launch a coroutine in another Dispatcher and return the result
loadMovies()
}
showMovies(movies)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment