
TypeScript 4 Design Patterns and Best Practices
By :

Bridge is a structural design pattern that acts as a connecting point between an abstraction and its implementation. Instead of having a class implement a functionality, we try to separate it into two pieces. The first part is the abstraction (that is, common interface methods) and the second part is the implementation. This is one more pattern that avoids using inheritance and allows more implementors to be added in the future.
One analogy of this pattern is having a universal remote control that works with any TV, even with TVs that are yet to arrive on the market. As long as they communicate using a common interface, you can have different types of remote controls and different types of TVs.
Let's now learn when to use the Bridge pattern.
The main reasons to use Bridge are as follows: