MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / drainQueue

Function drainQueue

code/event-handlers/public/app.js:838–860  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

836}
837
838function drainQueue() {
839 if (draining) {
840 return;
841 }
842 var timeout = runTimeout(cleanUpNextTick);
843 draining = true;
844
845 var len = queue.length;
846 while(len) {
847 currentQueue = queue;
848 queue = [];
849 while (++queueIndex < len) {
850 if (currentQueue) {
851 currentQueue[queueIndex].run();
852 }
853 }
854 queueIndex = -1;
855 len = queue.length;
856 }
857 currentQueue = null;
858 draining = false;
859 runClearTimeout(timeout);
860}
861
862process.nextTick = function (fun) {
863 var args = new Array(arguments.length - 1);

Callers 1

cleanUpNextTickFunction · 0.70

Calls 2

runTimeoutFunction · 0.70
runClearTimeoutFunction · 0.70

Tested by

no test coverage detected