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
I've noticed a quite important inconsistency in the way JSON-Patch handles registering the same callback multiple times, on the same observed object.
It turns out, that registering the same callback multiple times, on the same object using jsonpatch.observe, which takes advantage of native Object.observe function, causes callback to be invoked the same number of times, if any changes occur in the observed object, whereas jsonpatch.observe using Object.observe shim invokes the callback only once, no matter how many times the jsonpatch.observe function was called.
Worth mentioning is a fact, that native Object.observe acts as jsonpatch.observe with shim.
I've noticed a quite important inconsistency in the way JSON-Patch handles registering the same callback multiple times, on the same observed object.
It turns out, that registering the same callback multiple times, on the same object using
jsonpatch.observe
, which takes advantage of nativeObject.observe
function, causes callback to be invoked the same number of times, if any changes occur in the observed object, whereasjsonpatch.observe
usingObject.observe
shim invokes the callback only once, no matter how many times thejsonpatch.observe
function was called.Worth mentioning is a fact, that native
Object.observe
acts asjsonpatch.observe
with shim.I've prepared a set of test cases: http://jsfiddle.net/Qyb4w/
The text was updated successfully, but these errors were encountered: