Skip to content

Instantly share code, notes, and snippets.

@ktutnik
Last active May 1, 2019 00:42
Show Gist options
  • Save ktutnik/3711af18d3917adb4984b37cbdd5cf98 to your computer and use it in GitHub Desktop.
Save ktutnik/3711af18d3917adb4984b37cbdd5cf98 to your computer and use it in GitHub Desktop.
TypeScript decorator example
//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