Appearance
throttleWithLock
▸ throttleWithLock(fn
, wait?
, options?
): Function
使用 throttle 函数实现带有锁定功能的节流函数。
参数
Name | Type | Default value | Description |
---|---|---|---|
fn | Function | undefined | 要执行的函数。 |
wait? | number | 3000 | 每次触发函数后的等待时间,在该时间间隔内不会再次执行函数。 |
options? | Object | undefined | 配置选项。 |
options.leading | undefined | boolean | undefined | 是否在触发开始时立即执行一次函数。 |
options.trailing | undefined | boolean | undefined | 是否在触发结束后再执行一次函数。 |
返回值
Function
- 经过节流处理后的函数。