A tree data structure that emits events on updates, even if the modification is triggered by one of the leaves, making it easier to think in a reactive way.
MIT License
1.28k
stars
56
forks
source link
Allow to wrap objects in leafs so that they are not manipulated by freezer #82
This PR adds the possibility to wrap objects in a "Leaf", which is guaranteed to be not manipulated by freezer. This is useful when handling with native objects or functions which should remain intact and untouched (see #81). Accessing the content of a leaf can be done via a simple get method.
var example = {
e: Freezer.createLeaf({ func: function() { return true; } })
};
freezer = new Freezer( example );
var unwrappedLeaf = freezer.getData().e.get();
unwrappedLeaf.func() === true;
This change is just a suggestion. I'm happy to discuss a different interface/solution.
This PR adds the possibility to wrap objects in a "Leaf", which is guaranteed to be not manipulated by freezer. This is useful when handling with native objects or functions which should remain intact and untouched (see #81). Accessing the content of a leaf can be done via a simple
get
method.This change is just a suggestion. I'm happy to discuss a different interface/solution.