title: How does polymers observe-js works?
body: <p>I'm looking at the code of <a href="https://github.com/Polymer/observe-js/blob/master/src/observe.js" rel="nofollow">Polymers observe-js</a>, and I can't quite grasp how it works. I'm not talking about the dirty checking, but on the invocation of it - when does the check being performed?</p>
  
  <p>It looks like the magic is here:</p>
  
  <pre><code>var runEOM = hasObserve ? (function(){
  return function(fn) {
    return Promise.resolve().then(fn);
  }
  })() :
  (function() {
    return function(fn) {
      eomTasks.push(fn);
    };
  })();
  </code></pre>
  
  <p>Since Promise.resolve().then(fn) invokes fn at the end of the callback stack this line defers fs, similarly to setTimeout(0, fn) or process.nextTick(fn)</p>
  
  <p>But runEOM is never used in the file!</p>
  
  <p>Can anybody spread light on this?</p>