Created
March 6, 2022 20:44
-
-
Save KhomDrake/1a6ca61ec9a27ec067de9645c1e21c4e to your computer and use it in GitHub Desktop.
This file contains hidden or 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 makeLogin(login: String, password: String, callback: (Token) -> Unit) { | |
// request login | |
callback(token) | |
} | |
suspend fun loadMovies(callback: (List<Movie>) -> Unit) { | |
makeLogin("someValue", "someValue") { token -> | |
// request movies with token | |
callback(movies) | |
} | |
} | |
fun someFunction() { | |
loadMovies { movies -> | |
printMovies(movies) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment