Created
October 10, 2017 06:26
-
-
Save Yang03/a95018de754c092ff009d514f6aa0d81 to your computer and use it in GitHub Desktop.
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
function fnWrapDecorator(fn) { | |
return (...args) => { | |
return (target, propertyKey, descriptor) => { | |
const fn = descriptor.value | |
let wrappedFn = fn.applay(null, [fn, ...args]) | |
return { | |
configurable: true, | |
get() { | |
return fn | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://gist.github.com/ccnokes/a72cafdf4b7e0788b6994c8b5e02becc