You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks! I see what's wrong here. Arrays of objects compare equal due to getValueOf() only supporting arrays of simple types. The commit that fixed #1195 did compare arrays using getValueOf(). Might need to extend getValueOf() to support objects and go nested.
Extend getValueOf() to support "Object". Would be tempting to do JSON.stringify() but that wouldnt support binary types so better to do a nested call to getValueOf().
Did simplify this a bit and remove some code.
We only need to go deep diffing when both ap and bp are POJOs. All else can be treated as diff.
This means that updating an object with an array property that has identical content but is another array instance, will be treated as a diff. This is ok. I don't think we earn so much by using getValueOf() to do some half-baked comparision between arrays.
See https://jsfiddle.net/ygaprkbe/2/
In the console you will see
{}
but it should be the object in theupdate
call.So far I've only seen this when updating items inside of an array.
Also, most likely a related bug: https://jsfiddle.net/ygaprkbe/3/
The modifications object here is
{ foo.bar: 444 }
which seems similar to this old bug #1195The text was updated successfully, but these errors were encountered: