debounce-promise
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -23,2 +23,4 @@ /* global setTimeout, clearTimeout */ | ||
return function () { | ||
var _this = this; | ||
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { | ||
@@ -38,2 +40,3 @@ args[_key] = arguments[_key]; | ||
reject = _reject; | ||
onTimeout = run.bind(_this, nextArgs, resolve, reject); | ||
}); | ||
@@ -40,0 +43,0 @@ } |
@@ -19,2 +19,3 @@ /* global setTimeout, clearTimeout */ | ||
reject = _reject | ||
onTimeout = run.bind(this, nextArgs, resolve, reject) | ||
}) | ||
@@ -21,0 +22,0 @@ } |
{ | ||
"name": "debounce-promise", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Create a debounced version of a promise returning function", | ||
@@ -5,0 +5,0 @@ "main": "dist/index", |
@@ -8,2 +8,10 @@ /* global setTimeout */ | ||
} | ||
test('returns the result of a single operation ', async t => { | ||
const debounced = debounce(async (value) => value, 100) | ||
const promise = debounced('foo') | ||
const result = await promise | ||
t.equal(result, 'foo') | ||
}) | ||
test('returns the result of the latest operation ', async t => { | ||
@@ -10,0 +18,0 @@ const debounced = debounce(async (value) => value, 100) |
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
11602
197