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 prepared a set of test cases: http://jsfiddle.net/Qyb4w/
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.observefunction, causes callback to be invoked the same number of times, if any changes occur in the observed object, whereasjsonpatch.observeusingObject.observeshim invokes the callback only once, no matter how many times thejsonpatch.observefunction was called.Worth mentioning is a fact, that native
Object.observeacts asjsonpatch.observewith shim.I've prepared a set of test cases: http://jsfiddle.net/Qyb4w/