Open kcarnold opened 9 years ago
+1
Can we see move some times? for example:
var list1 = Immutable.fromJS([1,2,3,4]);
var list2 = Immutable.fromJS([1,2,4,3]);
var result = diff(list1, list2);
// now: List [ Map { "op": "replace", "path": "/2", "value": 4 }, Map { "op": "replace", "path": "/3", "value": 3 } ]
// better: List [ Map { "op": "move", "from": "/2", "path": "/3" } ]
I don't think that https://github.com/intelie/immutable-js-diff/blob/master/tests/sequenceDiff.test.js#L71 is the desired behavior; rather, it should be:
Note that this diff does not include
4
, which did not change. Why this matters:4
was instead some large data structure, the patch would be unnecessarily large4
.