Created
October 28, 2017 18:43
-
-
Save nybblr/1495efb60017da2d9046bbf01a064c4b to your computer and use it in GitHub Desktop.
Metaproxy: The proxy that doesn't do anything
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
/* Metaproxy | |
* The proxy that doesn't do anything | |
**/ | |
let target = { a: 1, b: 2, c: 3 } | |
let handler = new Proxy({}, { | |
get: (...args) => Reflect[args[1]](...args) | |
}) | |
let pixie = new Proxy(target, handler) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment