From afab656cfea0fab7899847e5b087532cc1ba6cb3 Mon Sep 17 00:00:00 2001 From: moonformeli Date: Fri, 11 Jan 2019 16:45:15 +0900 Subject: [PATCH] Change type check and the way of sending params. (#4145) --- throttle.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/throttle.js b/throttle.js index 2dbfdf02b..287b9ce50 100644 --- a/throttle.js +++ b/throttle.js @@ -53,7 +53,7 @@ function throttle(func, wait, options) { let leading = true let trailing = true - if (typeof func != 'function') { + if (typeof func !== 'function') { throw new TypeError('Expected a function') } if (isObject(options)) { @@ -61,9 +61,9 @@ function throttle(func, wait, options) { trailing = 'trailing' in options ? !!options.trailing : trailing } return debounce(func, wait, { - 'leading': leading, + leading, + trailing, 'maxWait': wait, - 'trailing': trailing }) }