I'm attempting to implement a debounce function with a 500ms delay. I found guidance in the documentation provided here.
methods: {
// Retrieve necessary data for the page
fetchData: _.debounce(function () {
this.$http.get('widgets/quickfindordernumber/' + this.quickFindOrderNumber).then(function (response) {
console.log(response.body)
}, function (error) {
console.log(error);
});
}, 500)
}
However, upon execution of this function, an error is displayed in the console stating
Uncaught ReferenceError: _ is not defined
. I have attempted to remove the underscore (_) preceding debounce but received an error indicating that debounce is also undefined.