@deckdeckgo/utils
Advanced tools
Comparing version 1.0.0-rc.1 to 1.0.0-rc.1-1
@@ -0,1 +1,6 @@ | ||
<a name="1.0.0-rc.1-1"></a> | ||
# 1.0.0-rc.1-1 (2019-09-01) | ||
* improvate `debounce` typing | ||
<a name="1.0.0-rc.1"></a> | ||
@@ -2,0 +7,0 @@ # 1.0.0-rc.1 (2019-08-30) |
export declare function unifyEvent(e: any): any; | ||
export declare function debounce(func: Function, timeout?: number): ($args: any) => void; | ||
export declare function debounce(func: Function, timeout?: number): (...args: any[]) => void; | ||
export declare function isMobile(): boolean; | ||
export declare function isIOS(): boolean; | ||
export declare function isFullscreen(): boolean; |
@@ -6,7 +6,8 @@ export function unifyEvent(e) { | ||
let timer; | ||
return ($args) => { | ||
return (...args) => { | ||
const next = () => func(...args); | ||
if (timer) { | ||
clearTimeout(timer); | ||
} | ||
timer = setTimeout(func, timeout > 0 ? timeout : 300, $args); | ||
timer = setTimeout(next, timeout && timeout > 0 ? timeout : 300); | ||
}; | ||
@@ -13,0 +14,0 @@ } |
{ | ||
"name": "@deckdeckgo/utils", | ||
"version": "1.0.0-rc.1", | ||
"version": "1.0.0-rc.1-1", | ||
"author": "David Dal Busco", | ||
@@ -5,0 +5,0 @@ "description": "A collection of utils methods and functions developed for DeckDeckGo", |
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
7847
82