Last active
May 1, 2019 00:42
-
-
Save ktutnik/3711af18d3917adb4984b37cbdd5cf98 to your computer and use it in GitHub Desktop.
TypeScript decorator example
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
//decorator that does noting | |
function noop(){ | |
return (...args:any[]) => {} | |
} | |
//target | |
class AnimalClass { | |
@noop() | |
list(index:number, limit:number): any[] { | |
return [] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment