@cripty2001/utils 0.0.221 → 0.0.223
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-ui/button.js +4 -1
- package/dist/react-whispr.js +6 -6
- package/package.json +1 -1
package/dist/react-ui/button.js
CHANGED
|
@@ -18,7 +18,10 @@ function Button({ onClick, children, className }) {
|
|
|
18
18
|
await p;
|
|
19
19
|
}
|
|
20
20
|
})()
|
|
21
|
-
.catch(e =>
|
|
21
|
+
.catch(e => {
|
|
22
|
+
console.trace("Caught error in button", e);
|
|
23
|
+
setError(e instanceof Error ? e.message : "Unknown error");
|
|
24
|
+
})
|
|
22
25
|
.finally(() => setLoading(false));
|
|
23
26
|
};
|
|
24
27
|
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col h-full w-full gap-2", children: [(0, jsx_runtime_1.jsx)("div", { onClick: handleClick, className: className, style: {
|
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