managed-object-proxy
v0.1.5
Published
A managed object proxy.
Downloads
15
Maintainers
Readme
managed-object-proxy
What is it?
A managed object proxy that allows you listen to all changes in the object, including child object.
Quick start
import Watchable from "managed-object-proxy";
const proxy = new Watchable();
const obj = proxy.init({});
const listener = (v, where) => {
if (typeof v === "object") {
console.log(`> ${JSON.stringify(v)} @ ${where}`);
} else {
console.log(`> ${v} @ ${where}`);
}
});
proxy.registerTrigger(listener);
// starting from here feel free to make any changes to the object.
proxy.unregisterTrigger(listener);
Documents
We currently not offering documents. To understand APIs please read the source code, it's not a large file.