Skip to content

Instantly share code, notes, and snippets.

@jelkand
Created September 13, 2019 18:53
Show Gist options
  • Save jelkand/a2d2bf1fc0076764b26b7bac1cede53a to your computer and use it in GitHub Desktop.
Save jelkand/a2d2bf1fc0076764b26b7bac1cede53a to your computer and use it in GitHub Desktop.
const attachProxy = (target) => {
const handler = {
set(obj, prop, value) {
console.log('setting value of prop:', prop, 'to value:', value, 'obj', obj);
console.trace();
return Reflect.set(...arguments);
}
};
return new Proxy(target, handler);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment