MCPcopy Index your code
hub / github.com/krasimir/react-in-patterns / drainQueue

Function drainQueue

code/composition/public/app.js:1006–1028  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1004}
1005
1006function drainQueue() {
1007 if (draining) {
1008 return;
1009 }
1010 var timeout = runTimeout(cleanUpNextTick);
1011 draining = true;
1012
1013 var len = queue.length;
1014 while(len) {
1015 currentQueue = queue;
1016 queue = [];
1017 while (++queueIndex < len) {
1018 if (currentQueue) {
1019 currentQueue[queueIndex].run();
1020 }
1021 }
1022 queueIndex = -1;
1023 len = queue.length;
1024 }
1025 currentQueue = null;
1026 draining = false;
1027 runClearTimeout(timeout);
1028}
1029
1030process.nextTick = function (fun) {
1031 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