Created
November 4, 2018 16:40
-
-
Save myeonginwoo/ca7ffb1c026f2a43eb60384c3da7d5e3 to your computer and use it in GitHub Desktop.
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
| class MainViewModel(val view: MainView) { | |
| private var currentItem: Item by Delegates.observable(Item.ITEM_A, | |
| { _: KProperty<*>, oldItem: Item, newItem: Item -> | |
| view.onUpdatedItem(oldItem, newItem) | |
| }) | |
| fun onClicked(item: Item) { | |
| currentItem = item | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment