All Downloads are FREE. Search and download functionalities are using the official Maven repository.

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"]}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy