Skip to content

Instantly share code, notes, and snippets.

@Dornhoth
Last active November 29, 2019 17:36
Show Gist options
  • Save Dornhoth/3f0850238c7bc7a0b0568fcd9b01f457 to your computer and use it in GitHub Desktop.
Save Dornhoth/3f0850238c7bc7a0b0568fcd9b01f457 to your computer and use it in GitHub Desktop.
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