1 var debounce = require(
'./debounce'),
2 isObject = require(
'./isObject');
5 var FUNC_ERROR_TEXT =
'Expected a function';
51 function throttle(func, wait, options) {
55 if (typeof func !=
'function') {
56 throw new TypeError(FUNC_ERROR_TEXT);
58 if (isObject(options)) {
59 leading =
'leading' in options ? !!options.leading : leading;
60 trailing =
'trailing' in options ? !!options.trailing : trailing;
62 return debounce(func, wait, {
69 module.exports = throttle;