Skip to content

Instantly share code, notes, and snippets.

@raulmoyareyes
Last active July 29, 2018 16:33
Show Gist options
  • Save raulmoyareyes/12efe30705455abf793f3ba15da425f9 to your computer and use it in GitHub Desktop.
Save raulmoyareyes/12efe30705455abf793f3ba15da425f9 to your computer and use it in GitHub Desktop.
Interface Segregation Principle
class Car {
startEngine() {}
accelerate() {}
}
class Seat extends Car {
startEngine() {
// start engine...
}
accelerate() {
// accelerate...
}
}
const TimeMachine = Super => class extends Super {
backToThePast() {}
backToTheFuture() {}
};
class DeloRean extends TimeMachine(Car) {
startEngine() {
// start engine...
}
accelerate() {
// accelerate...
}
backToThePast() {
// back to the past...
}
backToTheFuture() {
// back to the future...
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment