-
Notifications
You must be signed in to change notification settings - Fork 213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deleting Array elements #47
Comments
Same issue here. I guess if you just loop through the diff and apply the changes one by one, the former index 3 will be index 2 after the deletion of thing3. The next applyChange then triggers a delete on thing4, which is recorded to be index 3, but now there is no index 3, so nothing happens. |
For a workaround see here: |
I am also seeing this issue where the index seems to be changed and the diff index is no longer accurate... The workaround mentioned by @jonathan-reisdorf in #35 is to call
The default behaviour of |
+1 Same issue. Can the |
Not sure but I think I've run into an issue dealing with deleting array elements. For example:
oldArray: [thing1, thing2, thing3, thing4]
newArray: [thing1, thing2]
I apply the diff using this code:
diff.observableDiff(oldArray, newArray, function (d) {
diff.applyChange(oldArray, newArray, d);
});
And I expect:
oldArray: [thing1, thing2]
But I get:
oldArray: [thing1, thing2, thing4]
Not sure why this is. Is this an issue with my code or yours. Any help is greatly appreciated. Thanks in advance.
The text was updated successfully, but these errors were encountered: