Skip to content

Instantly share code, notes, and snippets.

@umarov
Created January 25, 2018 23:20
Show Gist options
  • Save umarov/a2fcf75bf7fab8d4c7d785690acc9281 to your computer and use it in GitHub Desktop.
Save umarov/a2fcf75bf7fab8d4c7d785690acc9281 to your computer and use it in GitHub Desktop.
TodoListDetailAdapter(context) { todoItem, actionType ->
when (actionType) {
TodoItem.CREATE -> todoListDetailViewModel.createTodoItem(todoItem)
TodoItem.UPDATE -> todoListDetailViewModel.updateTodoItem(todoItem)
TodoItem.DELETE -> todoListDetailViewModel.deleteTodoItem(todoItem)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment