Understand that there may be individuals quick to flag this as a duplicate question, but trust me when I say that I have exhaustively searched on Google for almost an hour before turning to ask here.
methods: {
stylizeHeader: debounce(event => {
if (event.target.scrollTop <= 1 && !this.scrolled) {
this.scrolled = true;
console.log('true');
} else if (this.scrolled) {
this.scrolled = false;
console.log('false');
}
}, 20),
},
My framework is Vue, and my goal is simply to access the this
property within the debounce function in connection with the outer scope, which is a detail of Vue implementation. The main issue lies with the arrow function.
I have tried different syntactical permutations like () { }
without success. While using function() { }
works fine, it triggers eslint warnings and I prefer to adhere to current conventions.
Is there a proper way to write it in ES6 so that I can successfully access this
?