April 2018
Beginner
536 pages
13h 21m
English
In this chapter, we learned how to consume and implement the four available types of decorators (class, method, property, and parameter). We used decorators to mutate the original classes to understand how they work but we also learned that we should avoid using decorators to mutate the prototype of a class. We also learned how to create a decorator factory to abstract developers from the decorator types when they are consumed, how to pass configuration to a decorator, and how to use the reflection metadata API to access type information at runtime. As we have already mentioned, decorators in TypeScript are still an experimental feature, which doesn't mean that they are not ready for their usage in production systems but that their ...