Skip to content

Instantly share code, notes, and snippets.

@eduardomoroni
Last active June 26, 2018 16:40
Show Gist options
  • Save eduardomoroni/7b425b4ed64224261bcd16eff6141e23 to your computer and use it in GitHub Desktop.
Save eduardomoroni/7b425b4ed64224261bcd16eff6141e23 to your computer and use it in GitHub Desktop.
Counter Entity
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