Skip to content

Instantly share code, notes, and snippets.

@gskachkov
Last active November 6, 2017 20:34
Show Gist options
  • Save gskachkov/125ab788eeed41a945b31349ee8a3130 to your computer and use it in GitHub Desktop.
Save gskachkov/125ab788eeed41a945b31349ee8a3130 to your computer and use it in GitHub Desktop.
const handler = {
defineProperty: function(target, property, descriptor) {
if (property.charAt(0) === "_") return false;
return Reflect.defineProperty(target, property, descriptor);
}
};
const proxy = new Proxy({}, handler);
proxy.id = "ABCD"; // { id: 'ABCD' }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment