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

Function drainQueue

code/controlled-uncontrolled/public/app.js:832–854  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

830}
831
832function drainQueue() {
833 if (draining) {
834 return;
835 }
836 var timeout = runTimeout(cleanUpNextTick);
837 draining = true;
838
839 var len = queue.length;
840 while(len) {
841 currentQueue = queue;
842 queue = [];
843 while (++queueIndex < len) {
844 if (currentQueue) {
845 currentQueue[queueIndex].run();
846 }
847 }
848 queueIndex = -1;
849 len = queue.length;
850 }
851 currentQueue = null;
852 draining = false;
853 runClearTimeout(timeout);
854}
855
856process.nextTick = function (fun) {
857 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