Skip to content

Registering the same callback multiple times #20

Closed
psmolenski opened this Issue Oct 24, 2013 · 1 comment

2 participants

@psmolenski

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/

@warpech
Collaborator
warpech commented Oct 28, 2013

Fix released in version 0.3.5

@warpech warpech closed this Oct 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.