loadEntity can use entityCache, but loadEntityVersion should not

This commit is contained in:
Bryan Housel
2017-08-24 15:02:12 -04:00
parent cabc98649f
commit cd05c51432
3 changed files with 52 additions and 10 deletions
+2 -2
View File
@@ -6,7 +6,7 @@ export function utilIdleWorker(tasks, processor, callback) {
function worker(deadline) {
while (deadline.timeRemaining() > 0 && currentPos < totalTasks) {
var result = processor(tasks[currentPos]);
// if falsy dont add to the processed list
if (result) processed.push(result);
currentPos++;
@@ -15,7 +15,7 @@ export function utilIdleWorker(tasks, processor, callback) {
// more tasks are left, we might need more idleCallbacks
if (currentPos < totalTasks) {
return window.requestIdleCallback(function(deadline) {worker(deadline);});
}
}
// tasks are completed
return callback(processed);