@cripty2001/utils 0.0.246 → 0.0.248

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.
@@ -91,14 +91,13 @@ export declare function useAsync<I, O>(f: (input: I, setProgress: (p: number) =>
91
91
  /**
92
92
  * Like useAsync, but it also automatically re-execute the async function periodically
93
93
  *
94
- * @param f @see useAsync
95
94
  * @param data @see useAsync
96
95
  * @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
96
+ * @param f @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, debounce?: number): Dispatcher<any, O>;
100
+ export declare function useAsyncPeriodic<I, O>(data: I, interval: number, f: (input: I, setProgress: (p: number) => void, signal: AbortSignal) => Promise<O>): 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
  *
@@ -200,22 +200,21 @@ function useAsync(f, data, debouce = 200) {
200
200
  /**
201
201
  * Like useAsync, but it also automatically re-execute the async function periodically
202
202
  *
203
- * @param f @see useAsync
204
203
  * @param data @see useAsync
205
204
  * @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
205
+ * @param f @see useAsync
207
206
  *
208
207
  * @returns @see useAsync
209
208
  */
210
- function useAsyncPeriodic(f, data, interval, debounce) {
209
+ function useAsyncPeriodic(data, interval, f) {
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, debounce]);
218
- return useAsync((i, p, s) => f(i.data, p, s), bundle, debounce);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cripty2001/utils",
3
- "version": "0.0.246",
3
+ "version": "0.0.248",
4
4
  "description": "Internal Set of utils. If you need them use them, otherwise go to the next package ;)",
5
5
  "homepage": "https://github.com/cripty2001/utils#readme",
6
6
  "bugs": {