MCPcopy Create free account
hub / github.com/TruthHun/BookStack / queueWatcher

Function queueWatcher

static/vuejs/vue.runtime.js:2375–2396  ·  view source on GitHub ↗

* Push a watcher into the watcher queue. * Jobs with duplicate IDs will be skipped unless it's * pushed when the queue is being flushed.

(watcher)

Source from the content-addressed store, hash-verified

2373 * pushed when the queue is being flushed.
2374 */
2375function queueWatcher (watcher) {
2376 var id = watcher.id;
2377 if (has[id] == null) {
2378 has[id] = true;
2379 if (!flushing) {
2380 queue.push(watcher);
2381 } else {
2382 // if already flushing, splice the watcher based on its id
2383 // if already past its id, it will be run next immediately.
2384 var i = queue.length - 1;
2385 while (i >= 0 && queue[i].id > watcher.id) {
2386 i--;
2387 }
2388 queue.splice(Math.max(i, index) + 1, 0, watcher);
2389 }
2390 // queue the flush
2391 if (!waiting) {
2392 waiting = true;
2393 nextTick(flushSchedulerQueue);
2394 }
2395 }
2396}
2397
2398/* */
2399

Callers 1

vue.runtime.jsFile · 0.70

Calls 1

nextTickFunction · 0.50

Tested by

no test coverage detected