intelie / immutable-js-diff

MIT License
261 stars 32 forks source link

Issue with removing and updating a List #9

Closed Jador closed 8 years ago

Jador commented 8 years ago

when removing an item and updating an item in the same list the diff removes the updated element twice, while not attempting to remove the deleted item at all

Example:

diff(List([1, 2, 3]), List([1, 2])).toJS();
// [ { op: "remove", path: "/2" } ]
diff(List([1, 2, 3]), List([1, 'a'])).toJS();
// [ { op: "remove", path: "/1" },  { op: "remove", path: "/1" },  { op: "add", path: "/1", value: "a" } ]
Jador commented 8 years ago

Actually, referencing back to the rfc, I do believe your behaviour is correct. Time to go bother the api developer.