Created
July 29, 2018 16:32
-
-
Save raulmoyareyes/c17b74259a80b11b309501afb5d429ad to your computer and use it in GitHub Desktop.
Interface Segregation Principle TS
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 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