Last active
May 29, 2019 17:45
-
-
Save phenomnomnominal/26db020ed49477ba0ccc5f2d8fbd6e14 to your computer and use it in GitHub Desktop.
Example of a class decorator-like function
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 Decorator (constructor) { | |
constructor.bang = 'boop!'; | |
return constructor; | |
} | |
const MyClass = Decorator(class _MyClass { }); | |
console.log(MyClass.bang); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment