@blake.regalia/belt
Advanced tools
Comparing version 0.48.1 to 0.48.2
@@ -21,5 +21,6 @@ import type { Promisable } from './types'; | ||
* @param xt_delay - executes once this amount of time has passed after the last hit | ||
* @param xt_idle - executes once this amount of time has passed after the last execution | ||
* @param n_calls - executes once this number of hits has occurred after initial hit | ||
* @returns | ||
*/ | ||
export declare const Debouncer: (f_exec: () => Promisable<any>, xt_span: number, xt_delay?: number, n_calls?: number) => Debouncer; | ||
export declare const Debouncer: (f_exec: () => Promisable<any>, xt_span: number, xt_delay?: number, xt_idle?: number, n_calls?: number) => Debouncer; |
@@ -27,2 +27,5 @@ "use strict"; | ||
} | ||
// set a timeout to execute once the idle passes | ||
if ((0, belt_1.is_finite)(k_this.i)) | ||
k_this.I = setTimeout(() => k_this.t(), k_this.i); | ||
}, | ||
@@ -88,2 +91,3 @@ /** | ||
* @param xt_delay - executes once this amount of time has passed after the last hit | ||
* @param xt_idle - executes once this amount of time has passed after the last execution | ||
* @param n_calls - executes once this number of hits has occurred after initial hit | ||
@@ -93,3 +97,3 @@ * @returns | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
const Debouncer = (f_exec, xt_span, xt_delay = Infinity, n_calls = Infinity) => (0, belt_1.assign)((0, belt_1.create)(G_PROTOTYPE), { | ||
const Debouncer = (f_exec, xt_span, xt_delay = Infinity, xt_idle = Infinity, n_calls = Infinity) => (0, belt_1.assign)((0, belt_1.create)(G_PROTOTYPE), { | ||
// execution callback | ||
@@ -100,2 +104,3 @@ f: f_exec, | ||
d: xt_delay, | ||
i: xt_idle, | ||
n: n_calls, | ||
@@ -102,0 +107,0 @@ // fields |
@@ -21,5 +21,6 @@ import type { Promisable } from './types'; | ||
* @param xt_delay - executes once this amount of time has passed after the last hit | ||
* @param xt_idle - executes once this amount of time has passed after the last execution | ||
* @param n_calls - executes once this number of hits has occurred after initial hit | ||
* @returns | ||
*/ | ||
export declare const Debouncer: (f_exec: () => Promisable<any>, xt_span: number, xt_delay?: number, n_calls?: number) => Debouncer; | ||
export declare const Debouncer: (f_exec: () => Promisable<any>, xt_span: number, xt_delay?: number, xt_idle?: number, n_calls?: number) => Debouncer; |
@@ -24,2 +24,5 @@ import { defer } from './async'; | ||
} | ||
// set a timeout to execute once the idle passes | ||
if (is_finite(k_this.i)) | ||
k_this.I = setTimeout(() => k_this.t(), k_this.i); | ||
}, | ||
@@ -85,2 +88,3 @@ /** | ||
* @param xt_delay - executes once this amount of time has passed after the last hit | ||
* @param xt_idle - executes once this amount of time has passed after the last execution | ||
* @param n_calls - executes once this number of hits has occurred after initial hit | ||
@@ -90,3 +94,3 @@ * @returns | ||
// eslint-disable-next-line @typescript-eslint/naming-convention | ||
export const Debouncer = (f_exec, xt_span, xt_delay = Infinity, n_calls = Infinity) => assign(create(G_PROTOTYPE), { | ||
export const Debouncer = (f_exec, xt_span, xt_delay = Infinity, xt_idle = Infinity, n_calls = Infinity) => assign(create(G_PROTOTYPE), { | ||
// execution callback | ||
@@ -97,2 +101,3 @@ f: f_exec, | ||
d: xt_delay, | ||
i: xt_idle, | ||
n: n_calls, | ||
@@ -99,0 +104,0 @@ // fields |
{ | ||
"name": "@blake.regalia/belt", | ||
"version": "0.48.1", | ||
"version": "0.48.2", | ||
"repository": "github:blake-regalia/belt", | ||
@@ -5,0 +5,0 @@ "license": "ISC", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
381648
7255