
TypeScript 4 Design Patterns and Best Practices
By :

The Adapter pattern deals with interfacing two different objects without changing their implementation part. You want to call new object methods using an existing interface but because they don't have something in common, you use a wrapper to connect them. Let's understand this concept in detail.
An Adapter is like a wrapper. It wraps one object in a new structure or interface that can be used in a client that expects that interface. This way, you can expand the usage of a particular object and make it work across incompatible interfaces.
We explain the fundamental reasons to use this pattern next.
In general terms, you want to use this pattern whenever you want to solve the following problems: