Decorators in TypeScript
Interactive Business Systems is now Planet Technology. Looking for a new job? We work with some of the biggest names in tech, and we’re hiring! Check out our open jobs and make your next career move with Planet.
Decorators are an experimental feature of TypeScript and, to an extent, of JavaScript itself. They are a concept borrowed from Python, and a way to modify classes using higher order functionality.
The idea is that you pass the class/function/attribute through a function and the result becomes the class/function/attribute.
As an example, if you make a @final decorator and have the code…