@etsoo/shared 1.1.13 → 1.1.14
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/README.md +1 -0
- package/lib/cjs/ExtendUtils.js +3 -2
- package/lib/cjs/types/DelayedExecutorType.d.ts +2 -1
- package/lib/mjs/ExtendUtils.js +3 -2
- package/lib/mjs/types/DelayedExecutorType.d.ts +2 -1
- package/package.json +1 -1
- package/src/ExtendUtils.ts +3 -2
- package/src/types/DelayedExecutorType.ts +2 -1
package/README.md
CHANGED
package/lib/cjs/ExtendUtils.js
CHANGED
|
@@ -34,14 +34,15 @@ var ExtendUtils;
|
|
|
34
34
|
return {
|
|
35
35
|
/**
|
|
36
36
|
* Call the function
|
|
37
|
+
* @param miliseconds Delayed miliseconds for this call
|
|
37
38
|
* @param args Args
|
|
38
39
|
*/
|
|
39
|
-
call(...args) {
|
|
40
|
+
call(miliseconds, ...args) {
|
|
40
41
|
this.clear();
|
|
41
42
|
seed = window.setTimeout((...args) => {
|
|
42
43
|
func(...args);
|
|
43
44
|
seed = 0;
|
|
44
|
-
}, delayMiliseconds, ...args);
|
|
45
|
+
}, miliseconds !== null && miliseconds !== void 0 ? miliseconds : delayMiliseconds, ...args);
|
|
45
46
|
},
|
|
46
47
|
/**
|
|
47
48
|
* Clear
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export declare type DelayedExecutorType<P extends any[]> = {
|
|
2
2
|
/**
|
|
3
3
|
* Call the function
|
|
4
|
+
* @param miliseconds Delayed miliseconds for this call
|
|
4
5
|
* @param args Args
|
|
5
6
|
*/
|
|
6
|
-
call(...args: P): void;
|
|
7
|
+
call(miliseconds?: number, ...args: P): void;
|
|
7
8
|
/**
|
|
8
9
|
* Clear
|
|
9
10
|
*/
|
package/lib/mjs/ExtendUtils.js
CHANGED
|
@@ -31,14 +31,15 @@ export var ExtendUtils;
|
|
|
31
31
|
return {
|
|
32
32
|
/**
|
|
33
33
|
* Call the function
|
|
34
|
+
* @param miliseconds Delayed miliseconds for this call
|
|
34
35
|
* @param args Args
|
|
35
36
|
*/
|
|
36
|
-
call(...args) {
|
|
37
|
+
call(miliseconds, ...args) {
|
|
37
38
|
this.clear();
|
|
38
39
|
seed = window.setTimeout((...args) => {
|
|
39
40
|
func(...args);
|
|
40
41
|
seed = 0;
|
|
41
|
-
}, delayMiliseconds, ...args);
|
|
42
|
+
}, miliseconds !== null && miliseconds !== void 0 ? miliseconds : delayMiliseconds, ...args);
|
|
42
43
|
},
|
|
43
44
|
/**
|
|
44
45
|
* Clear
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
export declare type DelayedExecutorType<P extends any[]> = {
|
|
2
2
|
/**
|
|
3
3
|
* Call the function
|
|
4
|
+
* @param miliseconds Delayed miliseconds for this call
|
|
4
5
|
* @param args Args
|
|
5
6
|
*/
|
|
6
|
-
call(...args: P): void;
|
|
7
|
+
call(miliseconds?: number, ...args: P): void;
|
|
7
8
|
/**
|
|
8
9
|
* Clear
|
|
9
10
|
*/
|
package/package.json
CHANGED
package/src/ExtendUtils.ts
CHANGED
|
@@ -35,16 +35,17 @@ export namespace ExtendUtils {
|
|
|
35
35
|
return {
|
|
36
36
|
/**
|
|
37
37
|
* Call the function
|
|
38
|
+
* @param miliseconds Delayed miliseconds for this call
|
|
38
39
|
* @param args Args
|
|
39
40
|
*/
|
|
40
|
-
call(...args: P) {
|
|
41
|
+
call(miliseconds?: number, ...args: P) {
|
|
41
42
|
this.clear();
|
|
42
43
|
seed = window.setTimeout(
|
|
43
44
|
(...args: P) => {
|
|
44
45
|
func(...args);
|
|
45
46
|
seed = 0;
|
|
46
47
|
},
|
|
47
|
-
delayMiliseconds,
|
|
48
|
+
miliseconds ?? delayMiliseconds,
|
|
48
49
|
...args
|
|
49
50
|
);
|
|
50
51
|
},
|