feat: event timer

This commit is contained in:
cv
2021-04-10 15:25:34 +02:00
parent 01e911eb24
commit 7293b0dfd9
3 changed files with 95 additions and 8 deletions
+51
View File
@@ -0,0 +1,51 @@
const Timer = require('./Timer');
/*
* EventTimer adds functions specific to APP
* namely:
* - Presenter message, text and status
* - Public message, text and status
*
*/
class EventTimer extends Timer {
presenter = {
text: '',
visible: false,
};
public = {
text: '',
visible: false,
};
constructor() {
super();
}
set presenterText(text) {
this.presenter.text = text;
}
set presenterVisible(state) {
this.presenter.visible = state;
}
set publicText(text) {
this.public.text = text;
}
set publicVisible(state) {
this.public.visible = state;
}
get presenter() {
return this.presenter;
}
get public() {
return this.public;
}
}
module.exports = EventTimer;
+6 -1
View File
@@ -1,3 +1,9 @@
/*
* Timer implements simple countdown timer functions
* User needs to use setup function to be able to use
*
*/
class Timer {
_current = null;
_finishAt = null;
@@ -116,5 +122,4 @@ class Timer {
}
}
module.exports = Timer;