Skip to content

Instantly share code, notes, and snippets.

@myeonginwoo
Created November 4, 2018 16:40
Show Gist options
  • Select an option

  • Save myeonginwoo/ca7ffb1c026f2a43eb60384c3da7d5e3 to your computer and use it in GitHub Desktop.

Select an option

Save myeonginwoo/ca7ffb1c026f2a43eb60384c3da7d5e3 to your computer and use it in GitHub Desktop.
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