Skip to content

Instantly share code, notes, and snippets.

@isaacs
Forked from ELLIOTTCABLE/gist:241671
Created November 24, 2009 05:40
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save isaacs/241672 to your computer and use it in GitHub Desktop.
Save isaacs/241672 to your computer and use it in GitHub Desktop.
function acquireaDependency () {
acquire('aDependency').addCallback(function(){
p.emitSuccess()
});
return p;
};
function acquireanotherDependency () {
var p = new Promise;
acquireaDependency().addCallback(function () {
acquire("anotherDependency").addCallback(function () {
p.emitSuccess();
});
});
return p;
};
function acquirethirdDependency () {
var p = new Promise;
acquireanotherDependency().addCallback(function () {
acquire("thirdDependency").addCallback(function () {
p.emitSuccess();
});
});
return p
};
function acquirefourthDependency () {
var p = new Promise;
acquire('fourthDependency').addCallback(function(){
acquirethirdDependency().addCallback(function () {
p.emitSuccess();
});
});
return p;
};
function doMyShiz () {
// do Something
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment