Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@nybblr
Created October 28, 2017 18:43
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nybblr/1495efb60017da2d9046bbf01a064c4b to your computer and use it in GitHub Desktop.
Save nybblr/1495efb60017da2d9046bbf01a064c4b to your computer and use it in GitHub Desktop.
Metaproxy: The proxy that doesn't do anything
/* 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