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

Function drainQueue

code/new-context-api/public/app.js:869–891  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

867}
868
869function drainQueue() {
870 if (draining) {
871 return;
872 }
873 var timeout = runTimeout(cleanUpNextTick);
874 draining = true;
875
876 var len = queue.length;
877 while(len) {
878 currentQueue = queue;
879 queue = [];
880 while (++queueIndex < len) {
881 if (currentQueue) {
882 currentQueue[queueIndex].run();
883 }
884 }
885 queueIndex = -1;
886 len = queue.length;
887 }
888 currentQueue = null;
889 draining = false;
890 runClearTimeout(timeout);
891}
892
893process.nextTick = function (fun) {
894 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