Created
October 24, 2022 04:40
-
-
Save semlinker/c6dfc01b1fdc14275da2dfc622f325ff to your computer and use it in GitHub Desktop.
Facade Pattern in TypeScript
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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