Skip to content

Instantly share code, notes, and snippets.

@semlinker
Created October 24, 2022 04:40
Show Gist options
  • Save semlinker/c6dfc01b1fdc14275da2dfc622f325ff to your computer and use it in GitHub Desktop.
Save semlinker/c6dfc01b1fdc14275da2dfc622f325ff to your computer and use it in GitHub Desktop.
Facade Pattern in TypeScript
interface Shape {
draw(): void;
}
class Circle implements Shape {
draw(): void {
console.log("Draw circle");
}
}
class Rectangle implements Shape {
draw(): void {
console.log("Draw rectangle");
}
}
class Triangle implements Shape {
draw(): void {
console.log("Draw triangle");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment