Comments (3)
@benqo Hi, to make it work like you describe, then we need a function to merge delete
and insert
changes at the same index to form a update
change.
However, how can we tell if an object has been changed or not? The way DeepDiff works now is to base on the hashValue
to tell if we are talking about the same object, usually we have object ID for uniqueness, and use Equatable
conformance to tell if any of its properties have changed, you can take a look at https://github.com/onmyway133/DeepDiff/blob/master/DeepDiffTests/HeckelTests.swift#L55
from deepdiff.
@onmyway133 thanks! Tried it again with my Hashable struct and works as expected. It detects if an object is replaced with a new (different) one or the same one is just updated.
from deepdiff.
@benqo Glad that it works for you 🥂
from deepdiff.
Related Issues (20)
- Support Swift Package Manager HOT 6
- Example using two String arrays HOT 6
- what about if people have String `ID` not `Int` HOT 1
- attempt to delete row 2 from section 0 which only contains 1 rows before the update
- Troubles with API HOT 2
- [Bug] Carthage update failed HOT 1
- Is the documentation correct for diff("abcd", "adbc")? HOT 1
- Add Swift's CollectionDifference to Performance tests HOT 1
- Build Library For Distribution (swift compatibility) HOT 8
- Is there any reason for this library to be MacOS 10.11+? HOT 2
- Crash: attempt to delete item 20 from section 0 which only contains 20 items before the update HOT 3
- How to use diffId when diffing SQL entities? HOT 3
- Error adding new section to collection view HOT 1
- Xcode 12 deployment warning when using Swift Package Manager HOT 2
- lifetime of Heckel? HOT 3
- Should I implement diifId If object is already conforming Hashable? HOT 1
- Unsupported watchOS version for PackageDescription version HOT 4
- Wrong version number 3.2.3 HOT 2
- Replace<T>' initializer is inaccessible due to 'internal' protection level HOT 1
- How to apply the changes to old-array HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from deepdiff.