(callback: VoidFunction)
| 70 | } |
| 71 | |
| 72 | remove(callback: VoidFunction) { |
| 73 | const {current, deferred} = this; |
| 74 | const callbackIndex = this.removeFromQueue(current, callback); |
| 75 | if (callbackIndex === -1) { |
| 76 | // Try cleaning up deferred queue only in case |
| 77 | // we didn't find a callback in the "current" queue. |
| 78 | this.removeFromQueue(deferred, callback); |
| 79 | } |
| 80 | // If the last callback was removed and there is a pending timeout - cancel it. |
| 81 | if (current.length === 0 && deferred.length === 0) { |
| 82 | this.clearTimeout(); |
| 83 | } |
| 84 | } |
| 85 | |
| 86 | private addToQueue( |
| 87 | target: Array<number | VoidFunction>, |
nothing calls this directly
no test coverage detected