title: Vuex best practices for complex objects
body: <p>My Vuex store contains objects with a variety of complexity.  Some have nested objects, some have arrays of nest objects. </p>
  
  <p>I could create generic function to mutate a specified property along the lines of:</p>
  
  <pre><code>setProperty(state,{ type, id, prop, value })
  {
    state[type][id][prop] = value;
  }
  </code></pre>
  
  <p>but that will quickly get complicated for nested object, arrays of objects.   It also seems very tedious to have to create a mutation for every single object property, nested or otherwise.</p>
  
  <p>What are the best practices for creating mutations to modify objects, nested objects, arrays, etc?</p>
  
  <p>Another related issue, is it considered bad form to pass the objects into the mutations as opposed to looking them up in the state:</p>
  
  <pre><code>setProperty(state,{ obj, prop, value })
  {
    obj[prop] = value;
  }
  </code></pre>