Skip to content

Instantly share code, notes, and snippets.

@sliskiCode
Last active December 5, 2017 21:16
Show Gist options
  • Select an option

  • Save sliskiCode/77e28f8d8f563ece006922425f45b02c to your computer and use it in GitHub Desktop.

Select an option

Save sliskiCode/77e28f8d8f563ece006922425f45b02c to your computer and use it in GitHub Desktop.
6 magic sugars that can make your Kotlin codebase happier #14
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