@meanie/angular-debounce
Advanced tools
Comparing version 2.0.0 to 2.1.0
{ | ||
"name": "@meanie/angular-debounce", | ||
"description": "A simple service for debouncing function calls", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"homepage": "https://github.com/meanie/angular-debounce", | ||
@@ -6,0 +6,0 @@ "author": { |
/** | ||
* @meanie/angular-debounce * https://github.com/meanie/angular-debounce | ||
* | ||
* Copyright (c) 2017 Adam Reis <adam@reis.nz> | ||
* Copyright (c) 2018 Adam Reis <adam@reis.nz> | ||
* License: MIT | ||
@@ -28,2 +28,5 @@ */ | ||
return function $debounce(fn, time) { | ||
for (var _len = arguments.length, args = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) { | ||
args[_key - 2] = arguments[_key]; | ||
} | ||
@@ -39,3 +42,3 @@ //Clear existing timeout | ||
debounces.delete(fn); | ||
return fn(); | ||
return fn.apply(undefined, args); | ||
}, time); | ||
@@ -42,0 +45,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,n,t){"use strict";n.module("Debounce.Service",[]).factory("$debounce",["$timeout",function(e){var n=new Map;return function(t,r){if(n.has(t)){var u=n.get(t);e.cancel(u)}var c=e(function(){return n.delete(t),t()},r);return n.set(t,c),c}}])}(window,window.angular); | ||
!function(e,n,r){"use strict";n.module("Debounce.Service",[]).factory("$debounce",["$timeout",function(e){var n=new Map;return function(r,t){for(var o=arguments.length,u=Array(o>2?o-2:0),a=2;a<o;a++)u[a-2]=arguments[a];if(n.has(r)){var c=n.get(r);e.cancel(c)}var i=e(function(){return n.delete(r),r.apply(void 0,u)},t);return n.set(r,i),i}}])}(window,window.angular); | ||
//# sourceMappingURL=angular-debounce.min.js.map |
@@ -18,3 +18,3 @@ | ||
*/ | ||
return function $debounce(fn, time) { | ||
return function $debounce(fn, time, ...args) { | ||
@@ -30,3 +30,3 @@ //Clear existing timeout | ||
debounces.delete(fn); | ||
return fn(); | ||
return fn(...args); | ||
}, time); | ||
@@ -33,0 +33,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
114419
183