Skip to content

Instantly share code, notes, and snippets.

@raulmoyareyes
Created July 29, 2018 16:32
Show Gist options
  • Save raulmoyareyes/c17b74259a80b11b309501afb5d429ad to your computer and use it in GitHub Desktop.
Save raulmoyareyes/c17b74259a80b11b309501afb5d429ad to your computer and use it in GitHub Desktop.
Interface Segregation Principle TS
class Car {
startEngine() {}
accelerate() {}
}
class Seat extends Car {
startEngine() {
// start engine...
}
accelerate() {
// accelerate...
}
}
class TimeMachine {
backToThePast() {}
backToTheFuture() {}
}
// No in JS, use TS
class DeloRean implements ***<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