-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating

TypeScript 5 Design Patterns and Best Practices - Second Edition
By :

Just as there are good design patterns and best practices when using TypeScript, there are some anti-patterns as well. When working on large-scale applications, you will inevitably come across some patterns or parts that look problematic, are hard to read and change, or promote dangerous behavior. This happens because as the application grows, you will need to write more code that fits the existing code base, and quite often, you will have to make some compromises.
Over time, as more people contribute to the same code space, you will see many inconsistencies – things such as god objects, inconsistent use of patterns, or even the excessive use of any types. God objects refer to classes or objects that know too much or do too much, thereby violating the Single-Responsibility Principle (SRP) and introducing complexity. In this chapter, we will look at approaches to work around these problems.
In this chapter, we will explore several important...