Skip to content

Instantly share code, notes, and snippets.

@KhomDrake
Created March 6, 2022 20:52
Show Gist options
  • Save KhomDrake/7032ee756171d6d64227370830faf43e to your computer and use it in GitHub Desktop.
Save KhomDrake/7032ee756171d6d64227370830faf43e to your computer and use it in GitHub Desktop.
suspend fun makeLogin(login: String, password: String) : Token {
// request login
return token
}
suspend fun loadMovies(token: Token) : List<Movie> {
val token = makeLogin("someValue", "someValue")
// request movies with token
return movies
}
fun someFunction() {
GlobalScope.launch {
val token = makeLogin("someValue", "someValue")
val movies = loadMovies(token)
printMovies(movies)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment