quidproquo-web-react 0.0.204 → 0.0.205
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.
|
@@ -6,13 +6,13 @@ function useRunEvery(func, interval) {
|
|
|
6
6
|
const [value, setValue] = (0, react_1.useState)(func);
|
|
7
7
|
const intervalRef = (0, react_1.useRef)(null);
|
|
8
8
|
(0, react_1.useEffect)(() => {
|
|
9
|
-
intervalRef.current = setInterval(() => {
|
|
9
|
+
intervalRef.current = window.setInterval(() => {
|
|
10
10
|
const newValue = func();
|
|
11
11
|
setValue(newValue);
|
|
12
12
|
}, interval * 1000);
|
|
13
13
|
return () => {
|
|
14
|
-
if (intervalRef.current) {
|
|
15
|
-
clearInterval(intervalRef.current);
|
|
14
|
+
if (intervalRef.current !== null) {
|
|
15
|
+
window.clearInterval(intervalRef.current);
|
|
16
16
|
intervalRef.current = null;
|
|
17
17
|
}
|
|
18
18
|
};
|
|
@@ -3,13 +3,13 @@ export function useRunEvery(func, interval) {
|
|
|
3
3
|
const [value, setValue] = useState(func);
|
|
4
4
|
const intervalRef = useRef(null);
|
|
5
5
|
useEffect(() => {
|
|
6
|
-
intervalRef.current = setInterval(() => {
|
|
6
|
+
intervalRef.current = window.setInterval(() => {
|
|
7
7
|
const newValue = func();
|
|
8
8
|
setValue(newValue);
|
|
9
9
|
}, interval * 1000);
|
|
10
10
|
return () => {
|
|
11
|
-
if (intervalRef.current) {
|
|
12
|
-
clearInterval(intervalRef.current);
|
|
11
|
+
if (intervalRef.current !== null) {
|
|
12
|
+
window.clearInterval(intervalRef.current);
|
|
13
13
|
intervalRef.current = null;
|
|
14
14
|
}
|
|
15
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "quidproquo-web-react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.205",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./lib/commonjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -29,10 +29,10 @@
|
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://github.com/joe-coady/quidproquo#readme",
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"quidproquo-core": "0.0.
|
|
33
|
-
"quidproquo-tsconfig": "0.0.
|
|
34
|
-
"quidproquo-webserver": "0.0.
|
|
35
|
-
"quidproquo-web": "0.0.
|
|
32
|
+
"quidproquo-core": "0.0.205",
|
|
33
|
+
"quidproquo-tsconfig": "0.0.205",
|
|
34
|
+
"quidproquo-webserver": "0.0.205",
|
|
35
|
+
"quidproquo-web": "0.0.205",
|
|
36
36
|
"typescript": "^4.9.3"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|