aboutsummaryrefslogtreecommitdiff
path: root/javascript/helpers.js
diff options
context:
space:
mode:
authorLiam <liamthekerr@gmail.com>2022-09-27 15:56:18 -0400
committerLiam <liamthekerr@gmail.com>2022-09-27 15:56:18 -0400
commit5034f7d7597685aaa4779296983be0f49f4f991f (patch)
treea4d2fe6104e5034fae22476d7705634a551359ff /javascript/helpers.js
parentca3e5519e8b6dc020c5e7ae508738afb5dc6f3ec (diff)
added token counter next to txt2img and img2img prompts
Diffstat (limited to 'javascript/helpers.js')
-rw-r--r--javascript/helpers.js13
1 files changed, 13 insertions, 0 deletions
diff --git a/javascript/helpers.js b/javascript/helpers.js
new file mode 100644
index 00000000..1b26931f
--- /dev/null
+++ b/javascript/helpers.js
@@ -0,0 +1,13 @@
+// helper functions
+
+function debounce(func, wait_time) {
+ let timeout;
+ return function wrapped(...args) {
+ let call_function = () => {
+ clearTimeout(timeout);
+ func(...args)
+ }
+ clearTimeout(timeout);
+ timeout = setTimeout(call_function, wait_time);
+ };
+} \ No newline at end of file