Last active
June 26, 2018 16:40
-
-
Save eduardomoroni/7b425b4ed64224261bcd16eff6141e23 to your computer and use it in GitHub Desktop.
Counter Entity
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
export class Counter { | |
count: number; | |
constructor(startNumber: number) { | |
this.count = startNumber; | |
} | |
increment(qty?: number) { | |
this.count += qty ? qty : 1; | |
} | |
decrement(qty?: number) { | |
this.count -= qty ? qty : 1; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment