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

Function queueWatcher

static/vuejs/vue.runtime.esm.js:2369–2390  ·  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

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

Callers 1

vue.runtime.esm.jsFile · 0.70

Calls 1

nextTickFunction · 0.50

Tested by

no test coverage detected