Last active
March 30, 2020 16:59
-
-
Save akexorcist/f809849afc2a5da99179f4b531d8a962 to your computer and use it in GitHub Desktop.
Code Snippet for https://blacklenspub.com/inline-function-in-kotlin-adb51b0eab76
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 doSomething() { | |
| ... | |
| doComplexTask("Akexorcist", { name -> | |
| "Mr.${name.trim()}" | |
| }, { fullName -> | |
| System.out.println("Hello, $fullName") | |
| }) | |
| } | |
| fun doComplexTask(name: String, | |
| method1: (name: String) -> String, | |
| method2: (fullName: String) -> Unit) { | |
| doSomething1(name) | |
| method1(name) | |
| doSomething2(name) | |
| method2(name) | |
| doSomething3(name) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment