DifferenceKit
DifferenceKit copied to clipboard
CollectionDifference API implementation
trafficstars
Checklist
- [x] Reviewed the README and documents.
- [x] Searched existing issues for ensure not duplicated.
Question
I want to mimic the behavior of CollectionDifference, so I started with
extension Array where Element: Differentiable {
public func diff(from other: Array) -> StagedChangeset<Array> {
StagedChangeset(source: self, target: other)
}
}
And I'd like to implement Array.apply method, but I'm not sure what is the right way to apply StagedChangeset to an existing collection...
Also I'm looking for how to implement Array.diff(from:by:) method