@deboxsoft/module-core
Advanced tools
Comparing version
@@ -630,11 +630,9 @@ 'use strict'; | ||
let timeout; | ||
return function () { | ||
const context = this, | ||
args = arguments; | ||
return (...args) => { | ||
timeout && clearTimeout(timeout); | ||
timeout = setTimeout(function () { | ||
timeout = null; | ||
if (!immediate) func.apply(context, args); | ||
if (!immediate) func.apply(this, args); | ||
}, wait); | ||
if (immediate && !timeout) func.apply(context, args); | ||
if (immediate && !timeout) func.apply(this, args); | ||
}; | ||
@@ -641,0 +639,0 @@ } |
{ | ||
"name": "@deboxsoft/module-core", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"license": "SEE LICENSE IN LICENSE", | ||
@@ -5,0 +5,0 @@ "maintainers": [ |
@@ -12,2 +12,2 @@ /** | ||
*/ | ||
export declare function debounce(func: Function, wait?: number, immediate?: boolean): () => void; | ||
export declare function debounce(func: () => void, wait?: number, immediate?: boolean): (...values: any[]) => void; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
66728
-0.01%1934
-0.21%