Last active
December 15, 2017 09:45
-
-
Save sliskiCode/ecfc14f9661dcf0afd57b195bb2a2171 to your computer and use it in GitHub Desktop.
6 magic sugars that can make your Kotlin codebase happier #22
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 ComponentInterface { | |
val onNavigationClick: (() -> Unit)? | |
var searchText: String | |
} | |
class Component : ComponentInterface { | |
private val navigable: Navigable = NavigableImpl() | |
private val searchable: Searchable = SearchableImpl() | |
override val onNavigationClick: (() -> Unit)? | |
get() = navigable.onNavigationClick | |
override var searchText: String = "" | |
get() = searchable.searchText | |
set(value) { | |
field = value | |
searchable.searchText = value | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment