diff

fun <T, I> diff(oldList: List<T>, newList: List<T>, idProvider: IdProvider<T, I>?): List<Patch<T>>

diffs to versions of a List by providing an IdProvider. The definition of an id to identify the same object in both Lists makes it possible to detect, if an object is moved from one position to another. Also, this method does not emit a Patch if values within an element change.

Return

a List of Patches needed to transform the old list into the new one

Parameters

oldList

old version of the List

newList

new version of the List