mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 19:37:49 +00:00
Change type check and the way of sending params. (#4145)
This commit is contained in:
committed by
John-David Dalton
parent
a7e0428889
commit
afab656cfe
@@ -53,7 +53,7 @@ function throttle(func, wait, options) {
|
|||||||
let leading = true
|
let leading = true
|
||||||
let trailing = true
|
let trailing = true
|
||||||
|
|
||||||
if (typeof func != 'function') {
|
if (typeof func !== 'function') {
|
||||||
throw new TypeError('Expected a function')
|
throw new TypeError('Expected a function')
|
||||||
}
|
}
|
||||||
if (isObject(options)) {
|
if (isObject(options)) {
|
||||||
@@ -61,9 +61,9 @@ function throttle(func, wait, options) {
|
|||||||
trailing = 'trailing' in options ? !!options.trailing : trailing
|
trailing = 'trailing' in options ? !!options.trailing : trailing
|
||||||
}
|
}
|
||||||
return debounce(func, wait, {
|
return debounce(func, wait, {
|
||||||
'leading': leading,
|
leading,
|
||||||
|
trailing,
|
||||||
'maxWait': wait,
|
'maxWait': wait,
|
||||||
'trailing': trailing
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user