@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 CHANGED
@@ -122,6 +122,7 @@ Extend current class/object functioning
122
122
  |Name|Description|
123
123
  |---:|---|
124
124
  |applyMixins|Apply mixins to current class|
125
+ |delayedExecutor|Create delayed executor|
125
126
  |promiseHandler|Promise handler to catch error|
126
127
  |sleep|Delay promise|
127
128
 
@@ -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
  */
@@ -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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@etsoo/shared",
3
- "version": "1.1.13",
3
+ "version": "1.1.14",
4
4
  "description": "TypeScript shared utilities and functions",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/mjs/index.js",
@@ -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
  },
@@ -1,9 +1,10 @@
1
1
  export 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
  /**
9
10
  * Clear