@tmsfe/tms-core 0.0.65 → 0.0.66
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/package.json +1 -1
- package/src/funcUtils.ts +2 -2
package/package.json
CHANGED
package/src/funcUtils.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @param wait 要延迟的时间,单位:毫秒
|
|
6
6
|
* @param immediate 首次调用或者超过wait时间间隔后调用时,是否先立即执行func
|
|
7
7
|
*/
|
|
8
|
-
function throttle(func: Function, wait
|
|
8
|
+
function throttle(func: Function, wait = 500, immediate = false): Function {
|
|
9
9
|
let context: object | null = null;
|
|
10
10
|
let args: IArguments | null = null;
|
|
11
11
|
let timer = 0;
|
|
@@ -43,7 +43,7 @@ function throttle(func: Function, wait: number, immediate = false): Function {
|
|
|
43
43
|
* @param wait 要延迟的时间,单位:毫秒
|
|
44
44
|
* @param immediate 首次调用或者超过wait时间间隔后调用时,是否先立即执行func
|
|
45
45
|
*/
|
|
46
|
-
function debounce(func: Function, wait
|
|
46
|
+
function debounce(func: Function, wait = 500, immediate = false): Function {
|
|
47
47
|
let args: IArguments | null = null;
|
|
48
48
|
let context: object | null = null;
|
|
49
49
|
let timer = 0;
|