proxy-every
v2.0.2
Published
new Proxy for Any
Downloads
5
Readme
proxy-every
Proxy Any !!
Install
npm i proxy-every
# or
yarn add proxy-every
Import
import proxyEvery from 'proxy-every';
Use
const source = {
h: 'h',
a: [1, 2, 3],
l: {
e: 'm',
o: 'n'
},
o: ['!!']
};
const Instance = new proxyEvery(source, {
// Docs for Handler: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy/Proxy
// Example
set(target, prop, value, receiver) {
target[prop] = value;
console.log(prop, value, target, receiver);
return true;
}
});
Instance.a[2] = 333; // 2, 333, [1, 2, 333], Proxy