-
-
Save Robitx/53fd0ee671e7349d3344b4fe46c4b37c to your computer and use it in GitHub Desktop.
A proxy with a handler.proxy always available.
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 = (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