Browse Source

Fix for browsers without ES6 support (#64)

* Fix for older browsers without ES6 support
pull/78/head
Tobias Reinwarth 6 years ago
committed by Mathias Markl
parent
commit
72c336d7d8
  1. 8
      muk_web_utils/static/src/js/underscore.js

8
muk_web_utils/static/src/js/underscore.js

@ -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);

Loading…
Cancel
Save