Skip to content

Instantly share code, notes, and snippets.

@WebReflection
Created May 22, 2018 14:42
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save WebReflection/694940dbdf56ab1390d11aa393c25419 to your computer and use it in GitHub Desktop.
Save WebReflection/694940dbdf56ab1390d11aa393c25419 to your computer and use it in GitHub Desktop.
A proxy with a handler.proxy always available.
const proxy = (target, handler) => {
handler = typeof handler === 'object' ?
Object.create(handler) : new handler;
return (handler.proxy = new Proxy(target, handler));
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment