Last active
March 30, 2020 16:57
-
-
Save akexorcist/203a52eb304831edf003f6becff06be8 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 startHere() { | |
| doAnything { | |
| System.out.println("Do something before 2nd thing") | |
| } | |
| } | |
| fun doAnything(block: () -> Unit) { | |
| System.out.println("Do 1st thing") | |
| block() | |
| System.out.println("Do 2nd thing") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment