package.dist.prod.util.debounce.js.map Maven / Gradle / Ivy
{
"version": 3,
"sources": ["../../../src/util/debounce.ts"],
"sourcesContent": ["import type { Timeout } from \"../types.js\";\n\n/**\n * Delays function execution by given threshold.\n * @param fn {Function}\n * @param delay {Integer}\n */\nlet debounceInterval: Timeout | null = null;\n\nconst debounce = (fn: () => void, delay: number) => {\n\tdebounceInterval && clearTimeout(debounceInterval);\n\tdebounceInterval = setTimeout(() => {\n\t\tdebounceInterval = null;\n\t\tfn();\n\t}, delay);\n};\n\nexport default debounce;\n"],
"mappings": "aAOA,IAAIA,EAAmC,KAEvC,MAAMC,EAAW,CAACC,EAAgBC,IAAkB,CACnDH,GAAoB,aAAaA,CAAgB,EACjDA,EAAmB,WAAW,IAAM,CACnCA,EAAmB,KACnBE,EAAG,CACJ,EAAGC,CAAK,CACT,EAEA,eAAeF",
"names": ["debounceInterval", "debounce", "fn", "delay"]
}