Last active
November 29, 2019 17:36
-
-
Save Dornhoth/3f0850238c7bc7a0b0568fcd9b01f457 to your computer and use it in GitHub Desktop.
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
class Greeter implements Person { | |
protected person: Person; | |
constructor(person: Person) { | |
this.person = person; | |
} | |
public greet(): string { | |
return this.person.greet(); | |
} | |
} | |
class HiGreeter extends Greeter { | |
public greet(): string { | |
return 'Hi!'; | |
} | |
} | |
class GoodMorningGreeter extends Greeter { | |
public greet(): string { | |
return 'Good morning!'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment