object Myer

Implementation of Myer's diff algorithm on two Lists creating a Flow of Patches.


Link copied to clipboard
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.