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

Function drainQueue

code/third-party/public/app.js:741–763  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

739}
740
741function drainQueue() {
742 if (draining) {
743 return;
744 }
745 var timeout = runTimeout(cleanUpNextTick);
746 draining = true;
747
748 var len = queue.length;
749 while(len) {
750 currentQueue = queue;
751 queue = [];
752 while (++queueIndex < len) {
753 if (currentQueue) {
754 currentQueue[queueIndex].run();
755 }
756 }
757 queueIndex = -1;
758 len = queue.length;
759 }
760 currentQueue = null;
761 draining = false;
762 runClearTimeout(timeout);
763}
764
765process.nextTick = function (fun) {
766 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