| 104 | } |
| 105 | |
| 106 | private removeFromQueue(target: Array<number | VoidFunction>, callback: VoidFunction) { |
| 107 | let index = -1; |
| 108 | for (let i = 0; i < target.length; i += 2) { |
| 109 | const queuedCallback = target[i + 1]; |
| 110 | if (queuedCallback === callback) { |
| 111 | index = i; |
| 112 | break; |
| 113 | } |
| 114 | } |
| 115 | if (index > -1) { |
| 116 | // Remove 2 elements: a timestamp slot and |
| 117 | // the following slot with a callback function. |
| 118 | arraySplice(target, index, 2); |
| 119 | } |
| 120 | return index; |
| 121 | } |
| 122 | |
| 123 | private scheduleTimer(ngZone: NgZone) { |
| 124 | const callback = () => { |