This file contains 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 Gear { | |
private _wheel: Wheel; | |
constructor( | |
readonly chainring: number, | |
readonly cog: number, | |
readonly rim: number, | |
readonly tire: number | |
) {} |
This file contains 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 Gear { | |
private _wheel: Wheel; | |
constructor( | |
readonly chainring: number, | |
readonly cog: number, | |
readonly rim: number, | |
readonly tire: number | |
) {} |
This file contains 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 Gear { | |
private _wheel: Wheel; | |
constructor( | |
readonly chainring: number, | |
readonly cog: number, | |
readonly rim: number, | |
readonly tire: number | |
) {} |
This file contains 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 Gear { | |
readonly wheel; | |
constructor( | |
readonly chainring: number, | |
readonly cog: number, | |
rim : number, | |
tire: number | |
) { | |
this.wheel = new Wheel(rim, tire); |
This file contains 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 Gear { | |
constructor( | |
readonly chainring: number, | |
readonly cog: number, | |
readonly wheel: { diameter: number } | |
) {} | |
get ratio() { | |
return this.chainring / this.cog; | |
} |
This file contains 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 Gear { | |
constructor( | |
readonly chainring: number, | |
readonly cog: number, | |
readonly rim: number, | |
readonly tire: number | |
) {} | |
get ratio() { | |
return this.chainring / this.cog; |
This file contains 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 ProceduralStopWatch { | |
public startTime; | |
public stopTime; | |
getElapsedTime = () => this.startMsTime - this.stopMsTime | |
} | |
// example | |
const stopWatch = new ProceduralStopWatch(); |
This file contains 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 Gear { | |
constructor(readonly chainring: number, readonly cog: number) {} | |
ratio() { | |
return this.chainring / this.cog; | |
} | |
} |
This file contains 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
module.exports = { | |
'extends': 'airbnb', | |
// "parser": "typescript-eslint-parser", | |
// "parserOptions": { | |
// "ecmaVersion": 6, | |
// "sourceType": "module", | |
// "ecmaFeatures": { | |
// "modules": true, | |
// "jsx": true | |
// } |
This file contains 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 Context{ | |
- StrategyA strategyA | |
- StrategyB strategyB | |
} | |
package PackageStrategyA { | |
interface StrategyA{ | |
+ excute() | |
} | |
NewerOlder