create-wirejs-app 2.0.105-async-api → 2.0.107
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -12,9 +12,11 @@ const realtimeService = new RealtimeService<{
|
|
|
12
12
|
|
|
13
13
|
const counter = new BackgroundJob('app', 'countdowns', {
|
|
14
14
|
handler: async (room: string, seconds: number) => {
|
|
15
|
+
console.log(`Starting countdown in room "${room}" for ${seconds} seconds.`);
|
|
15
16
|
return new Promise<void>((resolve) => {
|
|
16
17
|
let remaining = seconds;
|
|
17
18
|
const interval = setInterval(() => {
|
|
19
|
+
console.log(`Time remaining in room "${room}": ${remaining} seconds`);
|
|
18
20
|
if (remaining <= 0) {
|
|
19
21
|
clearInterval(interval);
|
|
20
22
|
resolve();
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"dompurify": "^3.2.3",
|
|
12
12
|
"marked": "^15.0.6",
|
|
13
13
|
"wirejs-dom": "^1.0.41",
|
|
14
|
-
"wirejs-resources": "^0.1.
|
|
15
|
-
"wirejs-components": "^0.1.
|
|
14
|
+
"wirejs-resources": "^0.1.102",
|
|
15
|
+
"wirejs-components": "^0.1.45"
|
|
16
16
|
},
|
|
17
17
|
"devDependencies": {
|
|
18
|
-
"wirejs-scripts": "^3.0.
|
|
18
|
+
"wirejs-scripts": "^3.0.100",
|
|
19
19
|
"typescript": "^5.7.3"
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
@@ -52,23 +52,24 @@ async function Chat() {
|
|
|
52
52
|
<!-- Countdown form -->
|
|
53
53
|
<form ${id('countdownForm')} onsubmit=${(event: Event) => {
|
|
54
54
|
event.preventDefault();
|
|
55
|
-
if (self.data.countdownDisabled) {
|
|
56
|
-
// discourage spamming the countdown
|
|
57
|
-
alert('Countdown is already running. One at a time please!');
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
55
|
self.data.countdownDisabled = true;
|
|
61
56
|
chat.startCountdown(null, self.data.room, self.data.countdownSeconds);
|
|
62
|
-
self.data.countdownSeconds = 10;
|
|
63
57
|
setTimeout(() => {
|
|
64
58
|
self.data.countdownDisabled = false;
|
|
65
59
|
}, self.data.countdownSeconds * 1000);
|
|
66
60
|
}}>
|
|
67
|
-
<input type='
|
|
68
|
-
|
|
61
|
+
<input type='number'
|
|
62
|
+
style='width: 10rem;'
|
|
69
63
|
value=${attribute('countdownSeconds', 10 as number)}
|
|
70
|
-
min='5' max='60'
|
|
71
|
-
|
|
64
|
+
min='5' max='60'
|
|
65
|
+
disabled=${attribute('countdownDisabled', false as boolean)}
|
|
66
|
+
/>
|
|
67
|
+
<input
|
|
68
|
+
type='submit'
|
|
69
|
+
style='width: 10rem;'
|
|
70
|
+
value='Start Counting'
|
|
71
|
+
disabled=${attribute('countdownDisabled', false as boolean)}
|
|
72
|
+
/>
|
|
72
73
|
</form>
|
|
73
74
|
|
|
74
75
|
<!-- Description -->
|