Created
June 14, 2015 16:16
-
-
Save oimou/5e83641949bdf30dac88 to your computer and use it in GitHub Desktop.
This file contains 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 loggableClass(target) { | |
console.log("Class: %s", target.name); | |
return target; | |
} | |
function loggableMethod(target, name, descriptor) { | |
console.log("Method: %s", name); | |
return descriptor; | |
} | |
var Klass = (function () { | |
function Klass() { | |
_classCallCheck(this, _Klass); | |
} | |
var _Klass = Klass; | |
_createDecoratedClass(_Klass, [{ | |
key: "hello", | |
decorators: [loggableMethod], | |
value: function hello() { | |
console.log("world"); | |
} | |
}]); | |
Klass = loggableClass(Klass) || Klass; | |
return Klass; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment