<h1>Test</h1>
var person = mobx.observable({
  firstName: 'Matt',
  lastName: 'Ruby',
  age: 37,
  get fullName () {
    return this.firstName + ' ' + this.lastName;
  }
});
var renderCount = 0;
mobx.autorun(function() {
  renderCount++;
  $('h1').text(person.fullName + ' render count: ' + renderCount);
});

// this will trigger the render one time
_.times(10, function() {
  person.age = _.random(20);
});
Run Pen

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://code.jquery.com/jquery-2.2.4.min.js
  2. https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.15.0/lodash.min.js
  3. https://unpkg.com/mobx@2.5.1/lib/mobx.umd.min.js