diff --git a/src/renderer/utils/debounce.js b/src/renderer/utils/debounce.js new file mode 100644 index 0000000..269d38c --- /dev/null +++ b/src/renderer/utils/debounce.js @@ -0,0 +1,11 @@ +const debounce = (func, delay) => { + let timer; + return (...args) => { + clearTimeout(timer); + timer = setTimeout(() => { + func(...args); + }, delay); + }; +}; + +export default debounce;