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

Function drainQueue

code/redux/public/app.js:1119–1141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1117}
1118
1119function drainQueue() {
1120 if (draining) {
1121 return;
1122 }
1123 var timeout = runTimeout(cleanUpNextTick);
1124 draining = true;
1125
1126 var len = queue.length;
1127 while(len) {
1128 currentQueue = queue;
1129 queue = [];
1130 while (++queueIndex < len) {
1131 if (currentQueue) {
1132 currentQueue[queueIndex].run();
1133 }
1134 }
1135 queueIndex = -1;
1136 len = queue.length;
1137 }
1138 currentQueue = null;
1139 draining = false;
1140 runClearTimeout(timeout);
1141}
1142
1143process.nextTick = function (fun) {
1144 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