Created
December 7, 2014 14:33
-
-
Save acnalesso/e3ad75a7bb89dfee932f to your computer and use it in GitHub Desktop.
DeferredActionQueues
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
flush: function() { | |
var queues = this.queues; | |
var queueNames = this.queueNames; | |
var queueName, queue, queueItems, priorQueueNameIndex; | |
var queueNameIndex = 0; | |
var numberOfQueues = queueNames.length; | |
var options = this.options; | |
while(queueNameIndex < numberOfQueues) { | |
queueName = queueNames[queueNameIndex]; | |
queue = queues[queueName]; | |
var numberOfQueueItems = queue._queue.length; | |
if (numberOfQueueItems === 0) { | |
queueNameIndex++; | |
} else { | |
queue.flush(false, /* async */); | |
queueNameIndex = 0; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment