Detect when mobx observable has changed
<p>Is it possible to detect when an observable changes in any way?</p>

<p>For instance, say you have this:</p>

<pre><code>@observable myObject = [{id: 1, name: 'apples'}, {id: 2, name: 'banana' }]
</code></pre>

<p>And later on, with some user input, the values change. How can I detect this easily? </p>

<p>I want to add a global "save" button, but only make it clickable if that observable has changed since the initial load.</p>

<p>My current solution is to add another observable <code>myObjectChanged</code> that returns true/false, and wherever a component changes the data in the myObject, I also add a line that changes the myObjectChanged to true. And if the save button is clicked, it saves and changes that observable back to false. </p>

<p>This results in lots of extra lines of code sprinkled throughout. Is there a better/cleaner way to do it?</p>