All Downloads are FREE. Search and download functionalities are using the official Maven repository.
Please wait. This can take some minutes ...
Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance.
Project price only 1 $
You can buy this project and download/modify it how often you want.
package.dist.util.debounce.js.map Maven / Gradle / Ivy
{"version":3,"file":"debounce.js","sourceRoot":"","sources":["../../src/util/debounce.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,IAAI,gBAAgB,GAAmB,IAAI,CAAC;AAE5C,MAAM,QAAQ,GAAG,CAAC,EAAc,EAAE,KAAa,EAAE,EAAE;IAClD,gBAAgB,IAAI,YAAY,CAAC,gBAAgB,CAAC,CAAC;IACnD,gBAAgB,GAAG,UAAU,CAAC,GAAG,EAAE;QAClC,gBAAgB,GAAG,IAAI,CAAC;QACxB,EAAE,EAAE,CAAC;IACN,CAAC,EAAE,KAAK,CAAC,CAAC;AACX,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","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"]}