title: MobX Store variable assignment
body: <p>What is the right way to assign value to MobX store variables?</p>
  
  <p>I understand that setting array should be done with the replace() function otherwise regular array will be assigned to the variable and not observable array.</p>
  
  <p>But what about objects? is the right way is to use setObject1() or setObject2()? I tried both options and both works</p>
  
  <p>What about primitive types and variable initiate with null? again regular assignment works but is it the right way?</p>
  
  <pre><code>class store {
    @observable array = [];
    @observable object = {};
    @observable primitive = 1;
    @observable nullObj = null
  
    @action setArray = array =&gt; {
      this.array.replace(array)
    }
  
    @action setObject1 = object =&gt; {
      this.object = object
    } 
  
    @action setObject2 = object =&gt; {
      this.object = observable(object)
    } 
  
    @action setPrimitive = primitive =&gt; {
      this.primitive = primitive
    }
  }
  </code></pre>