debounce-queue
Advanced tools
Comparing version 0.2.1 to 0.2.2
10
index.js
const defaultEnqueue = require('./enqueue'); | ||
module.exports = function debounceQueue(callback, delay, opts) { | ||
module.exports = function debounceQueue(callback, opts = {}) { | ||
if (typeof callback !== 'function') { | ||
@@ -8,9 +8,7 @@ throw new Error('Required: the function to debounce'); | ||
if (typeof delay !== 'number' && !opts) { | ||
opts = delay | ||
delay = opts.delay | ||
if (typeof opts === 'number') { | ||
opts = { delay: opts }; | ||
} | ||
opts = opts || {}; | ||
delay = delay || 100; | ||
const delay = opts.delay = opts.delay || 100; | ||
@@ -17,0 +15,0 @@ let queue = []; |
{ | ||
"name": "debounce-queue", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Like lodash.debounce but you get an array of all previous (unique) events", | ||
"repository": "laggingreflex/debounce-queue" | ||
} |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
3444
4
71
1