|
@ -18,7 +18,9 @@ |
|
|
**********************************************************************************/ |
|
|
**********************************************************************************/ |
|
|
|
|
|
|
|
|
_.mixin({ |
|
|
_.mixin({ |
|
|
memoizeDebounce: function(func, wait=0, options={}) { |
|
|
|
|
|
|
|
|
memoizeDebounce: function(func, wait, options) { |
|
|
|
|
|
wait = (typeof wait !== 'undefined') ? wait : 0; |
|
|
|
|
|
options = (typeof options !== 'undefined') ? options : {}; |
|
|
var mem = _.memoize(function() { |
|
|
var mem = _.memoize(function() { |
|
|
return _.debounce(func, wait, options) |
|
|
return _.debounce(func, wait, options) |
|
|
}, options.resolver); |
|
|
}, options.resolver); |
|
@ -29,7 +31,9 @@ _.mixin({ |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
_.mixin({ |
|
|
_.mixin({ |
|
|
memoizeThrottle: function(func, wait=0, options={}) { |
|
|
|
|
|
|
|
|
memoizeThrottle: function(func, wait, options) { |
|
|
|
|
|
wait = (typeof wait !== 'undefined') ? wait : 0; |
|
|
|
|
|
options = (typeof options !== 'undefined') ? options : {}; |
|
|
var mem = _.memoize(function() { |
|
|
var mem = _.memoize(function() { |
|
|
return _.throttle(func, wait, options) |
|
|
return _.throttle(func, wait, options) |
|
|
}, options.resolver); |
|
|
}, options.resolver); |
|
|