title: Vue Typescript callback: this implicitly has type any
body: <p>When using anonymous function with lodash debounce in my vue component for watch option, I got the typescript compiler error &quot;this implicityly has type any.</p>
  <p>Here is my component</p>
  <pre class="lang-js prettyprint-override"><code>export default defineComponent({
    data(){
      return {
         filters:{
            filter1: &quot;foo&quot;
         } as Record&lt;string, string&gt;
      }
    },
    methods:{
      load(){
         //load function
      }
    },
    watch:{
      &quot;filters&quot;:{
         deep: true,
         handler:_debounce(function(newValue){
             this.load() // &lt;= hear I got &quot;this implicitly has type any&quot;
         }, 500)
      }
    }
  })
  </code></pre>
  <p>I found on this post to use arrow function for my anonymous debounce callback function but the error still persists (<a href="https://stackoverflow.com/questions/48007891/ts2683ts-this-implicitly-has-type-any-because-it-does-not-have-a-type-ann">TS2683 (TS) &#39;this&#39; implicitly has type &#39;any&#39; because it does not have a type annotation</a>)</p>
  <p>Another solution is to pass &quot;this: any&quot; as an argument to the function, but I found this very ugly.</p>
  <pre class="lang-js prettyprint-override"><code>_debounce(function(this:any, newValue){
             this.load() // &lt;= hear I got &quot;this implicitly has type any&quot;
         }, 500)
  </code></pre>
  <p>Is there a better solution to handle this issue? (without setting noImplicitAny to false)</p>