title: Is it possible to trigger a function upon a Vue data element change?
body: <p>My API provides me a hash which I receive as part of an AJAX call. The content of the AJAX response (which includes the hash) is updating <code>data</code> components in my <code>Vue</code> instance (so that the DOM is modified, per usual Vue usage).</p>
  <p>I was wondering if it is possible to trigger (run) a function upon the change of a specific <code>data</code> element. <a href="https://v2.vuejs.org/v2/guide/reactivity.html" rel="nofollow noreferrer">Reactivity in Depth</a> does not mention this and for me (please correct me if this is wrong)  <code>computed</code>and <code>methods</code> are a way to indirectly provide new computed elements for the DOM (in other words, they do not start because a specific element was modified but are rather synchronisation methods between <code>data</code> and other variables provided to the DOM).</p>
  <p>I was hoping for something along the lines of (this is non-working, incorrect pseudo-code, I just add it to put in context of a Vue instance):</p>
  <pre><code>var vm = new Vue({
      el: '#root',
      data: {
        hash: null
      },
      functions_to_trigger_upon_an_element_change: {
        hash: function () {
          location.reload()
        }
      }
    })
  </code></pre>
  <p>The idea above would be to have <code>location.reload()</code> run when the value of <code>hash</code> changes.</p>
  <p><strong>Is there such a mechanism in Vue?</strong></p>
  <p>If there is not, I will keep the state independently of Vue and act accordingly upon its change but it would be nice to reuse the Vue watch properties to do that.</p>