Last active
August 29, 2015 14:08
-
-
Save craigp/a121e74f953643ffccb0 to your computer and use it in GitHub Desktop.
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
// var threadsToLoad = [], | |
// _thread; | |
// restrict number of threads to load | |
var threadsToLoad = (function _getThreads(loadThreads, allThreads) { | |
var thread = allThreads.shift(); | |
if (thread && loadThreads.length < settings.maxSourceListItemsToCache) { | |
loadThreads.push(thread); | |
return _getThreads(loadThreads, allThreads); | |
} else return loadThreads; | |
})([], threads); | |
// restrict number of threads to load | |
// while (threadsToLoad.length < settings.maxSourceListItemsToCache) { | |
// _thread = threads.shift(); | |
// if (_thread) | |
// threadsToLoad.push(_thread); | |
// else | |
// break; | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment