Last active
November 11, 2017 19:23
-
-
Save gskachkov/bf578fe4312a7c6ecbdca184d4c6234d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const proxy = new Proxy( | |
{ id: "id-0" }, | |
{ | |
set: function (target, property, value, receiver) { | |
if (property.charAt(0) === "_") return false; | |
target[property] = value; | |
return true; | |
} | |
... | |
} | |
); | |
console.log(proxy); | |
proxy._id = "_id-1"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment