for (let p of Object.getOwnPropertyNames(Reflect)) { logHandler[p] = function(...args) { logIt(p, args); return Reflect[p](...args); } }
-
-
new Proxy({}, {get(_, trapName){return (...args) => { log(), return Reflect[trapName](...args)}} is another option for your handler
-
"meta-handler" they call it. Benefit of a stratified API (handler is separate object than target)
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.