Last active
March 6, 2022 20:26
-
-
Save KhomDrake/49642365e17474916f39b9b3092cb659 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
fun makeLogin(login: String, password: String, callback: (Token) -> Unit) { | |
// request login | |
callback(token) | |
} | |
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