Mediator Pattern in TypeScript
Objects communicate through the Mediator rather than directly with each other.
As a system evolves and becomes larger and supports more complex functionality and business rules, the problem of communicating between these components becomes more complicated to understand and manage. It may be beneficial to refactor your system to centralize some or all of its functionality via some kind of mediation process.
The mediator pattern is similar to implementing the Facade pattern between your objects and processes. Except that the structure of the Mediator…