Commit 63d58d22 authored by wildfirecode13's avatar wildfirecode13

1

parent 1247711d
......@@ -4,4 +4,4 @@
* @param wait
* @param immediate
*/
export declare const debounce: (fn: Function, wait: number, immediate?: boolean) => () => void;
export declare const debounce: (fn: Function, wait?: number, immediate?: boolean) => () => void;
......@@ -8,7 +8,8 @@ exports.debounce = void 0;
* @param immediate
*/
exports.debounce = function (fn, wait, immediate) {
if (immediate === void 0) { immediate = false; }
if (wait === void 0) { wait = 2000; }
if (immediate === void 0) { immediate = true; }
var timer;
return function () {
if (timer)
......
......@@ -4,7 +4,7 @@
* @param wait
* @param immediate
*/
export const debounce = (fn:Function, wait:number, immediate = false) => {
export const debounce = (fn:Function, wait=2000, immediate = true) => {
let timer:number|null;
return function () {
if (timer) clearTimeout(timer)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment