Last active
December 5, 2017 21:16
-
-
Save sliskiCode/77e28f8d8f563ece006922425f45b02c to your computer and use it in GitHub Desktop.
6 magic sugars that can make your Kotlin codebase happier #14
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
| interface View { | |
| fun show() | |
| fun hide() | |
| fun reset() | |
| fun clear() | |
| } | |
| class Presenter(private val view: View) { | |
| fun present(isFructos: Boolean) = with(view) { | |
| if (isFructos) { | |
| show() | |
| hide() | |
| } else { | |
| hide() | |
| clear() | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment