@instructure/debounce 8.12.1-snapshot.45 → 8.12.1-snapshot.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/es/debounce.js +9 -2
- package/lib/debounce.js +9 -2
- package/package.json +3 -3
package/es/debounce.js
CHANGED
|
@@ -52,7 +52,9 @@
|
|
|
52
52
|
* Specify invoking on the trailing edge of the timeout.
|
|
53
53
|
* @returns {Function} Returns the new debounced function.
|
|
54
54
|
*/
|
|
55
|
-
function debounce(func
|
|
55
|
+
function debounce(func) {
|
|
56
|
+
let wait = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
57
|
+
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
56
58
|
let lastArgs;
|
|
57
59
|
let lastThis;
|
|
58
60
|
let result;
|
|
@@ -154,9 +156,14 @@ function debounce(func, wait = 0, options = {}) {
|
|
|
154
156
|
timers = [];
|
|
155
157
|
}
|
|
156
158
|
|
|
157
|
-
function debounced(
|
|
159
|
+
function debounced() {
|
|
158
160
|
const time = Date.now();
|
|
159
161
|
const isInvoking = shouldInvoke(time);
|
|
162
|
+
|
|
163
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
164
|
+
args[_key] = arguments[_key];
|
|
165
|
+
}
|
|
166
|
+
|
|
160
167
|
lastArgs = args; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
161
168
|
// @ts-ignore
|
|
162
169
|
|
package/lib/debounce.js
CHANGED
|
@@ -60,7 +60,9 @@ exports.default = void 0;
|
|
|
60
60
|
* Specify invoking on the trailing edge of the timeout.
|
|
61
61
|
* @returns {Function} Returns the new debounced function.
|
|
62
62
|
*/
|
|
63
|
-
function debounce(func
|
|
63
|
+
function debounce(func) {
|
|
64
|
+
let wait = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
|
|
65
|
+
let options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
64
66
|
let lastArgs;
|
|
65
67
|
let lastThis;
|
|
66
68
|
let result;
|
|
@@ -162,9 +164,14 @@ function debounce(func, wait = 0, options = {}) {
|
|
|
162
164
|
timers = [];
|
|
163
165
|
}
|
|
164
166
|
|
|
165
|
-
function debounced(
|
|
167
|
+
function debounced() {
|
|
166
168
|
const time = Date.now();
|
|
167
169
|
const isInvoking = shouldInvoke(time);
|
|
170
|
+
|
|
171
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
172
|
+
args[_key] = arguments[_key];
|
|
173
|
+
}
|
|
174
|
+
|
|
168
175
|
lastArgs = args; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
169
176
|
// @ts-ignore
|
|
170
177
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/debounce",
|
|
3
|
-
"version": "8.12.1-snapshot.
|
|
3
|
+
"version": "8.12.1-snapshot.46+51e6aff75",
|
|
4
4
|
"description": "A debounce util made by Instructure Inc.",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@instructure/ui-babel-preset": "8.12.1-snapshot.
|
|
26
|
+
"@instructure/ui-babel-preset": "8.12.1-snapshot.46+51e6aff75"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@babel/runtime": "^7.13.10"
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
34
|
"sideEffects": false,
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "51e6aff7502e7b0b22b107c9d39c2a8dc2c267f4"
|
|
36
36
|
}
|