return function loadFromLinks( baseUrl, cache ) {
...
links.forEach( function( link ) {
var name = getNameFromLink( link );
// one, two, three
loadSingle( link.getAttribute( 'href' ), baseUrl, cache ).then(...
// one, two, three, four
function loadSingle( path, parentUrl, baseUrl, cache ) {
var promise, url;
...