@cripty2001/utils 0.0.252 → 0.0.253
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 +5 -5
- package/package.json +1 -1
package/dist/react-whispr.js
CHANGED
|
@@ -245,11 +245,11 @@ function useAsync(data, debouce, interval, f) {
|
|
|
245
245
|
}
|
|
246
246
|
}, [data, setInput]);
|
|
247
247
|
// Initing refresh bundle
|
|
248
|
-
const timer = interval !== null ?
|
|
248
|
+
const timer = useSafeRef(() => interval !== null ?
|
|
249
249
|
(0, _1.getClock)(interval) :
|
|
250
|
-
whispr_1.Whispr.create(0)[0];
|
|
251
|
-
const [refresh, setRefresh] = whispr_1.Whispr.create(Math.random());
|
|
252
|
-
const bundle = whispr_1.Whispr.from({
|
|
250
|
+
whispr_1.Whispr.create(0)[0]);
|
|
251
|
+
const [refresh, setRefresh] = useSafeRef(() => whispr_1.Whispr.create(Math.random()));
|
|
252
|
+
const bundle = useSafeRef(() => whispr_1.Whispr.from({
|
|
253
253
|
input,
|
|
254
254
|
timer,
|
|
255
255
|
refresh
|
|
@@ -257,7 +257,7 @@ function useAsync(data, debouce, interval, f) {
|
|
|
257
257
|
data: input,
|
|
258
258
|
timer,
|
|
259
259
|
refresh
|
|
260
|
-
}));
|
|
260
|
+
})));
|
|
261
261
|
// Initing dispatcher
|
|
262
262
|
const dispatcher = useSafeRef(() => new Dispatcher_1.Dispatcher(bundle, (i, p, s) => f(i.data, p, s), debouce));
|
|
263
263
|
// Returning dispatcher and refresh function
|
package/package.json
CHANGED