MCPcopy
hub / github.com/keepfool/vue-tutorials / runBatcherQueue

Function runBatcherQueue

06.Router/basic/js/vue.js:3068–3086  ·  view source on GitHub ↗

* Run the watchers in a single queue. * * @param {Array} queue

(queue)

Source from the content-addressed store, hash-verified

3066 */
3067
3068 function runBatcherQueue(queue) {
3069 // do not cache length because more watchers might be pushed
3070 // as we run existing watchers
3071 for (var i = 0; i < queue.length; i++) {
3072 var watcher = queue[i];
3073 var id = watcher.id;
3074 has[id] = null;
3075 watcher.run();
3076 // in dev build, check and stop circular updates.
3077 if ('development' !== 'production' && has[id] != null) {
3078 circular[id] = (circular[id] || 0) + 1;
3079 if (circular[id] > config._maxUpdateCount) {
3080 warn('You may have an infinite update loop for watcher ' + 'with expression "' + watcher.expression + '"', watcher.vm);
3081 break;
3082 }
3083 }
3084 }
3085 queue.length = 0;
3086 }
3087
3088 /**
3089 * Push a watcher into the watcher queue.

Callers 1

flushBatcherQueueFunction · 0.70

Calls 1

warnFunction · 0.70

Tested by

no test coverage detected