Skip to content

Instantly share code, notes, and snippets.

@domenic
Forked from jorendorff/pipeline.js
Last active December 28, 2015 10:28
Show Gist options
  • Save domenic/7486049 to your computer and use it in GitHub Desktop.
Save domenic/7486049 to your computer and use it in GitHub Desktop.
load.metadata = {};
// Call the locate hook.
return loader.locate(name, {
name: load.name,
metadata: load.metadata
}).then(address => {
if (load.linkSets.size === 0)
return;
// This load still matters. Call the fetch hook.
load.address = address;
return loader.fetch({
name: load.name,
metadata: load.metadata,
address: address
});
}).then(source => {
if (load.linkSets.size === 0)
return;
// This load still matters. Call the translate hook.
return loader.translate({
name: load.name,
metadata: load.metadata,
address: load.address,
source: source
});
}).then(source => {
if (load.linkSets.size === 0)
return;
// This load still matters. Call the instantiate hook.
if (callFunction(std_Set_get_size, load.linkSets) === 0)
return;
load.source = source;
return loader.instantiate({
name: load.name,
metadata: load.metadata,
address: load.address,
source: source
});
}).then(InstantiateSucceeded).catch(LoadFailed);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment