@cripty2001/utils 0.0.221 → 0.0.222
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/dist/react-whispr.js +6 -6
- package/package.json +1 -1
package/dist/react-whispr.js
CHANGED
|
@@ -440,6 +440,12 @@ function useAsyncInput(value, setValue, handler, setPending = () => { }) {
|
|
|
440
440
|
];
|
|
441
441
|
}
|
|
442
442
|
function whisprFromExternal(getData, interval) {
|
|
443
|
+
const cleanup = () => {
|
|
444
|
+
if (intervalRef !== null) {
|
|
445
|
+
clearInterval(intervalRef);
|
|
446
|
+
}
|
|
447
|
+
};
|
|
448
|
+
const [value, setValue] = whispr_1.Whispr.create(getData(), cleanup);
|
|
443
449
|
const intervalRef = (() => {
|
|
444
450
|
return interval !== null ?
|
|
445
451
|
setInterval(() => {
|
|
@@ -447,12 +453,6 @@ function whisprFromExternal(getData, interval) {
|
|
|
447
453
|
}, interval) :
|
|
448
454
|
null;
|
|
449
455
|
})();
|
|
450
|
-
const cleanup = () => {
|
|
451
|
-
if (intervalRef !== null) {
|
|
452
|
-
clearInterval(intervalRef);
|
|
453
|
-
}
|
|
454
|
-
};
|
|
455
|
-
const [value, setValue] = whispr_1.Whispr.create(getData(), cleanup);
|
|
456
456
|
return {
|
|
457
457
|
data: value,
|
|
458
458
|
refresh: () => setValue(getData()),
|
package/package.json
CHANGED