Wrapping It Up with Decorators
summary
Shows concrete code: builds a method decorator that re-recorded live coding demonstrates replacing a getCities method with one that returns an Observable-wrapped error, then wires the component to display the error. Explains and uses property descriptors and the Reflect metadata API, outlines a decorator factory to pass a custom error message, and links a StackBlitz example. Covers deprecation, memoization, validation patterns and warns about code smells, so expect runnable examples and tradeoffs rather than abstract definitions.
AI-written summary · about
chapters (15)
- 0:00Start
- 1:37The Decorator Pattern
- 2:29Typescript Language Feature
- 5:10Decorator Definition
- 6:07Method Decorator
- 7:16Parameter Decorator
- 8:50Verifying Type Information at Runtime
- 10:18Demo
- 10:29Create a Simple Method Decorator
- 12:48Return an Observable
- 13:32Regular Method Decorator
- 15:59Passing in an Argument to Our Decorator
- 18:15Avoid Code Smells
- 18:37Core Decorators J / S Repo
- 20:45What Is Your Favorite Smash Brothers Character
related talks
17mWrapping it up with Decorators
48mFalling in love with decorators ES6/TypeScript
16mDiscover the power of decorators in TypeScript
46mTypeScript Decorators - Higher Order Functions in Disguise
32mDemystifying TypeScript Decorators
21mEnhancing Decorators with Type Annotations: Techniques and Best Practices
41mRefactoring from Callback Hell to Observables – Live Coding in TS
21mTypescript meta programming from 0 to 100
