dist/main.js
/**
   * Push a watcher into the watcher queue.
   * Jobs with duplicate IDs will be skipped unless it's
   * pushed when the queue is being flushed.
   */
Push a watcher into the watcher queue.
Jobs with duplicate IDs will be skipped unless it's
pushed when the queue is being flushed.
Push a watcher into the watcher queue . Jobs with duplicate IDs will be skipped unless it ' s pushed when the queue is being flushed .
function queueWatcher(watcher) {
    var id = watcher.id;
    if (has[id] == null) {
      has[id] = true;
      if (!flushing) {
        queue.push(watcher);
      } else {
        var i = queue.length - 1;
        while (i > index && queue[i].id > watcher.id) {
          i--;
        }
        queue.splice(i + 1, 0, watcher);
      }
      if (!waiting) {
        waiting = true;
        if (!config.async) {
          flushSchedulerQueue();
          return;
        }
        nextTick(flushSchedulerQueue);
      }
    }
  }
function queueWatcher ( watcher ) { var id = watcher . id ; if ( has [ id ] == null ) { has [ id ] = true ; if ( ! flushing ) { queue . push ( watcher ) ; } else { var i = queue . length - 1 ; while ( i > index && queue [ i ] . id > watcher . id ) { i -- ; } queue . splice ( i + 1 , 0 , watcher ) ; } if ( ! waiting ) { waiting = true ; if ( ! config . async ) { flushSchedulerQueue ( ) ; return ; } nextTick ( flushSchedulerQueue ) ; } } }
Push a watcher into the watcher queue.
Push a watcher into the watcher queue .
// if already flushing, splice the watcher based on its id // if already past its id, it will be run next immediately. // queue the flush