Skip to content

Instantly share code, notes, and snippets.

@designfrontier
Last active August 29, 2015 14:25
Show Gist options
  • Save designfrontier/77f5d768e77bb7604065 to your computer and use it in GitHub Desktop.
Save designfrontier/77f5d768e77bb7604065 to your computer and use it in GitHub Desktop.
pre-bernstein promise chains
somePromiseReturningFunction.then(function(data){
data.num++;
return data;
}).then(function(data){
data.num++;
return data;
}).then(function(data){
data.num++;
return data;
}).then(function(data){
data.num++;
return data;
}).then(function(data){
data.num++;
return data;
}).then(function(result){
console.log(result);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment