title: Why is this debounce function breaking "this"?
body: <p>I created a debounce utility function:</p>
  
  <pre><code>debounce (func, wait, immediate) {
    let timeout
    return function () {
      const context = this
      const args = arguments
      const later = function () {
        timeout = null
        if (!immediate) func.apply(context, args)
      }
      const callNow = immediate &amp;&amp; !timeout
      clearTimeout(timeout)
      timeout = setTimeout(later, wait)
      if (callNow) func.apply(context, args)
    }
  }
  </code></pre>
  
  <p>Which I use like this:</p>
  
  <pre><code>updateField: utils.debounce((event, fieldName, schema) =&gt; {
    const value = event.target.value
    this.$emit('updateField', fieldName, value, schema)
    validateFields(this)
  }, 500),
  </code></pre>
  
  <p>The debounce function works. However I get this error:</p>
  
  <pre><code>Uncaught TypeError: _this.$emit is not a function
  </code></pre>
  
  <p>What could be the problem?</p>