Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oscarg798/7f867091d18e4841f137ce5fae774923 to your computer and use it in GitHub Desktop.
Save oscarg798/7f867091d18e4841f137ce5fae774923 to your computer and use it in GitHub Desktop.
override fun getChangePayload(oldItemPosition: Int, newItemPosition: Int): Any? {
val oldItem = oldProducts[oldItemPosition]
val newItem = newProducts[newItemPosition]
if (oldItem.quantityInCart != newItem.quantityInCart) {
return UPDATE_QUANTITY
}
return null
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment