I know Vue.js has functionality built in to debounce on an input field. I have created a slider that fires a method that does not use an input field though, and I was wondering if I can take advantage of the debounce functionality inside of a method.
Is it even possible to use this functionality outside of simply adding a debounce to an input? Or do I need to write my own functionality for this?
I've just tried doing something like this but it does not seem to work:
this.$options.filters.debounce(this.search(), 2000);
For anyone who is wondering on how to do this. I fixed this by using an awesome little snippet I found:
Attribute in my data
Debounce functionality
You are put this.search() execution result into debounce, try this: