-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Original issue in canjs canjs/canjs/issues/2706
Corresponding bit-docs-prettify issue: bit-docs/bit-docs-prettify/issues/5
Where we loop over the packages, look for a deferred (has .then
) and wait for that to resolve before proceeding.
Something like:
function processPackages(packageIndex, callback){
var i = packageIndex || 0,
packageNames = Object.keys(window.PACKAGES),
packageName, packageResult;
if(i === packageNames.length){
if(typeof callback === 'function'){
callback();
}
return;
}
packageName = packageNames[i];
if (typeof window.PACKAGES[packageName] === 'function') {
packageResult = window.PACKAGES[packageName]();
if(packageResult && packageResult.then){
packageResult.then(function(){
processPackages(i+1, callback);
});
}else{
processPackages(i+1, callback);
}
}else{
processPackages(i+1, callback);
}
};
// go through every package and re-init
processPackages(0, function(){
init();
setDocTitle();
});
Metadata
Metadata
Assignees
Labels
No labels