Full typescript and mvvm implementation #3
@ -1,4 +1,4 @@
|
||||
class Stats {
|
||||
export class Stats {
|
||||
#score;
|
||||
#highScore;
|
||||
#highScoreStorageKey;
|
||||
@ -20,4 +20,12 @@ class Stats {
|
||||
localStorage.setItem(this.#highScoreStorageKey, this.#highScore);
|
||||
}
|
||||
}
|
||||
|
||||
get highScore() {
|
||||
return this.#highScore;
|
||||
}
|
||||
|
||||
get score() {
|
||||
return this.#score;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user