new Throttle()
- Source:
Example
const tr = new Throttle()
tr.throttle(fn,1000,...args)
Methods
throttle(argFn, argWait, …args) → {void}
- Description:
函数节流,触发一次后,再间隔n毫秒后才会被触发
- Source:
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
argFn |
function | 回调函数 |
||
argWait |
number |
1000
|
等待时间,默认1000毫秒 |
|
args |
any |
<repeatable> |
...args 回调函数的参数 |
Returns:
- Type
- void