Skip to content

Registering the same callback multiple times #20

@psmolenski

Description

@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/

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions