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

Function queueWatcher

static/vuejs/vue.esm.js:2373–2394  ·  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

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

Callers 1

vue.esm.jsFile · 0.70

Calls 1

nextTickFunction · 0.50

Tested by

no test coverage detected