Skip to content

Instantly share code, notes, and snippets.

@semlinker
Created October 24, 2022 05:24
Show Gist options
  • Save semlinker/60ea28ec1c9dd9183da06c2f3cd8e311 to your computer and use it in GitHub Desktop.
Save semlinker/60ea28ec1c9dd9183da06c2f3cd8e311 to your computer and use it in GitHub Desktop.
Facade Pattern in TypeScript
class Client {
private shapeFacade: ShapeFacade;
constructor() {
this.shapeFacade = new ShapeFacade();
}
drawShapes() {
this.shapeFacade.drawCircle();
this.shapeFacade.drawRectangle();
this.shapeFacade.drawTriangle();
}
}
const client = new Client();
client.drawShapes();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment