Palindrom / JSONPatcherProxy

ES6 proxy powered JSON Object observer that emits JSON patches when changes occur to your object tree.
94 stars 14 forks source link

Consider 2+ instances proxies collision #19

Closed alshakero closed 6 years ago

alshakero commented 7 years ago

Currently:

var obj = {
    one: [1, 2, 3, 4, 5],
    two: {
        raz: [6, 7, 6, 5, 4]
    }
};
var observedObj = new JSONPatcherProxy(obj).observe(true, callback);
var observedObjTwo = new JSONPatcherProxy(observedObj.two).observe(true, callback2);

delete observedObj.two.raz;

causes an issue. The obvious solution is to deep clone before proxification. But this is taxing and maybe it should be turned on only on demand.

warpech commented 7 years ago

Is this an issue with Starcounter apps? If not, then I propose to not worry about this for now (YAGNI).

alshakero commented 7 years ago

It is not.

warpech commented 7 years ago

Thanks for the update! Keeping it in the Freezer then

alshakero commented 6 years ago

I think let's close it for a cleaner repo. Multiple observation is not something we use