Skip to content
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

Registering the same callback multiple times #20

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

Registering the same callback multiple times #20

psmolenski opened this issue Oct 24, 2013 · 1 comment
Labels

Comments

@psmolenski
Copy link
Contributor

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
Copy link
Collaborator

warpech commented Oct 28, 2013

Fix released in version 0.3.5

@warpech warpech closed this as completed Oct 28, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants