@humandialog/forms.svelte 1.7.20 → 1.7.21
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/kicks.js +27 -0
- package/package.json +1 -1
package/kicks.js
CHANGED
|
@@ -6,11 +6,15 @@ let registeredObservers = []
|
|
|
6
6
|
let minInterval = 0
|
|
7
7
|
let lastCheckAt = 0
|
|
8
8
|
let timerId = 0;
|
|
9
|
+
let paused = false
|
|
9
10
|
|
|
10
11
|
let lastKicks = new Map();
|
|
11
12
|
|
|
12
13
|
export function registerKicksObserver(labels, interval, callback)
|
|
13
14
|
{
|
|
15
|
+
// temporary disabled
|
|
16
|
+
return 0;
|
|
17
|
+
|
|
14
18
|
let lbs = []
|
|
15
19
|
if(labels && Array.isArray(labels))
|
|
16
20
|
lbs = labels
|
|
@@ -33,6 +37,9 @@ export function registerKicksObserver(labels, interval, callback)
|
|
|
33
37
|
|
|
34
38
|
export function unregisterKicksObserver(regId)
|
|
35
39
|
{
|
|
40
|
+
// temporary disabled
|
|
41
|
+
return
|
|
42
|
+
|
|
36
43
|
const fIdx = registeredObservers.findIndex( (o) => o.id == regId)
|
|
37
44
|
if(fIdx >=0)
|
|
38
45
|
registeredObservers.splice(fIdx, 1)
|
|
@@ -96,6 +103,26 @@ function updateTimer()
|
|
|
96
103
|
checkKicks(false)
|
|
97
104
|
}
|
|
98
105
|
|
|
106
|
+
function pauseTimer()
|
|
107
|
+
{
|
|
108
|
+
if(timerId > 0)
|
|
109
|
+
{
|
|
110
|
+
clearTimeout(timerId)
|
|
111
|
+
timerId = 0
|
|
112
|
+
paused = true
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
function restoreTimer()
|
|
117
|
+
{
|
|
118
|
+
if(paused && minInterval)
|
|
119
|
+
{
|
|
120
|
+
timerId = setTimeout(timerHandler, minInterval*1000)
|
|
121
|
+
paused = false
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
|
|
99
126
|
function checkKicks(informObservers=true)
|
|
100
127
|
{
|
|
101
128
|
const s = get(session)
|