Deep replace data with a new Proxy listeners
proxify uses UMD, so it will work with globals, AMD, or Node-style module exports.
To install using npm:
npm install @clubajax/proxify --save
You can clone the repository with your generic clone commands as a standalone repository or submodule.
git clone git://github.com/clubajax/proxify.git
proxify has no dependencies.
The primary function is to make it to set change an object and all of its child objects to Proxies, so all changes will emit change-callbacks.
proxify supports modern browsers. IE11 is not tested but should work with a proxy shim.
This library uses UMD, meaning it can be consumed with RequireJS, Browserify (CommonJS), or a standard browser global.
proxifiedData = proxify(dataToBeProxified, options)
- onChange: called back when a property is set
- onSet: same as
- onGet: called back when a property is accessed
- filter: a function that returns a boolean. If the result is true, the passed data will not be proxified. properties will still be set, but events will not fire.
const data =x: 1deep:y: 2;const proxifiedData =;
While debugging, a proxified object is difficult to inspect, because of the Proxy layers.
To help with this, there are two methods,
proxifiedData.copy(); // returns a non-proxy copy proxifiedData.log(message); // sends a non-proxy copy to the console, with optionsla message
This uses the MIT license. Feel free to use, and redistribute at will.