MCPcopy Create free account
hub / github.com/EricSimons/ionic-course / processQueue

Function processQueue

code/songhop/www/lib/angular/angular.js:13126–13148  ·  view source on GitHub ↗
(state)

Source from the content-addressed store, hash-verified

13124 }
13125
13126 function processQueue(state) {
13127 var fn, promise, pending;
13128
13129 pending = state.pending;
13130 state.processScheduled = false;
13131 state.pending = undefined;
13132 for (var i = 0, ii = pending.length; i < ii; ++i) {
13133 promise = pending[i][0];
13134 fn = pending[i][state.status];
13135 try {
13136 if (isFunction(fn)) {
13137 promise.resolve(fn(state.value));
13138 } else if (state.status === 1) {
13139 promise.resolve(state.value);
13140 } else {
13141 promise.reject(state.value);
13142 }
13143 } catch (e) {
13144 promise.reject(e);
13145 exceptionHandler(e);
13146 }
13147 }
13148 }
13149
13150 function scheduleProcessQueue(state) {
13151 if (state.processScheduled || !state.pending) return;

Callers 1

scheduleProcessQueueFunction · 0.70

Calls 1

isFunctionFunction · 0.70

Tested by

no test coverage detected