diff options
author | 2020-06-14 19:33:29 +0200 | |
---|---|---|
committer | 2020-06-14 19:33:29 +0200 | |
commit | ffe25b87d257a05931fcba3be55eb7858ea41054 (patch) | |
tree | f9cfbed0b89ce6b24125c4f19f4bc39d12e6ee3f /src/utils/helpers.js | |
parent | eb4363244bf12f842adabf9dddb2fa0e37d689a8 (diff) | |
download | it-tools-ffe25b87d257a05931fcba3be55eb7858ea41054.tar.gz it-tools-ffe25b87d257a05931fcba3be55eb7858ea41054.tar.zst it-tools-ffe25b87d257a05931fcba3be55eb7858ea41054.zip |
feat: added MarkdownEditor.vue
Signed-off-by: Corentin Thomasset <corentin.thomasset74@gmail.com>
Diffstat (limited to '')
-rw-r--r-- | src/utils/helpers.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/utils/helpers.js b/src/utils/helpers.js index e847c42..f81190b 100644 --- a/src/utils/helpers.js +++ b/src/utils/helpers.js @@ -28,9 +28,19 @@ const isInt = (value) => { return Number.isInteger(value); } +const debounce = (callback, delay = 300) => { + let timer; + + return function(...args) { + clearTimeout(timer); + timer = setTimeout(() => callback(...args), delay); + } +} + export { copyToClipboard, fileIsImage, formatBytes, - isInt + isInt, + debounce }
\ No newline at end of file |