@cripty2001/utils 0.0.246 → 0.0.247
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.d.ts +1 -2
- package/dist/react-whispr.js +3 -4
- package/package.json +1 -1
package/dist/react-whispr.d.ts
CHANGED
|
@@ -94,11 +94,10 @@ export declare function useAsync<I, O>(f: (input: I, setProgress: (p: number) =>
|
|
|
94
94
|
* @param f @see useAsync
|
|
95
95
|
* @param data @see useAsync
|
|
96
96
|
* @param interval The interval to re-execute the async function. If null, the async function will not be re-executed.
|
|
97
|
-
* @param debounce @see useAsync
|
|
98
97
|
*
|
|
99
98
|
* @returns @see useAsync
|
|
100
99
|
*/
|
|
101
|
-
export declare function useAsyncPeriodic<I, O>(f: (input: I, setProgress: (p: number) => void, signal: AbortSignal) => Promise<O>, data: I, interval: number
|
|
100
|
+
export declare function useAsyncPeriodic<I, O>(f: (input: I, setProgress: (p: number) => void, signal: AbortSignal) => Promise<O>, data: I, interval: number): Dispatcher<any, O>;
|
|
102
101
|
/**
|
|
103
102
|
* Async version of useEffect with debouncing. Executes an async function as a side effect when data changes.
|
|
104
103
|
*
|
package/dist/react-whispr.js
CHANGED
|
@@ -203,19 +203,18 @@ function useAsync(f, data, debouce = 200) {
|
|
|
203
203
|
* @param f @see useAsync
|
|
204
204
|
* @param data @see useAsync
|
|
205
205
|
* @param interval The interval to re-execute the async function. If null, the async function will not be re-executed.
|
|
206
|
-
* @param debounce @see useAsync
|
|
207
206
|
*
|
|
208
207
|
* @returns @see useAsync
|
|
209
208
|
*/
|
|
210
|
-
function useAsyncPeriodic(f, data, interval
|
|
209
|
+
function useAsyncPeriodic(f, data, interval) {
|
|
211
210
|
const timer = useClock(interval);
|
|
212
211
|
const bundle = (0, react_1.useMemo)(() => {
|
|
213
212
|
return {
|
|
214
213
|
data,
|
|
215
214
|
interval
|
|
216
215
|
};
|
|
217
|
-
}, [data, timer
|
|
218
|
-
return useAsync((i, p, s) => f(i.data, p, s), bundle
|
|
216
|
+
}, [data, timer]);
|
|
217
|
+
return useAsync((i, p, s) => f(i.data, p, s), bundle);
|
|
219
218
|
}
|
|
220
219
|
/**
|
|
221
220
|
* Async version of useEffect with debouncing. Executes an async function as a side effect when data changes.
|
package/package.json
CHANGED