Skip to content

Instantly share code, notes, and snippets.

@mgiuffrida
Created January 26, 2016 04:46
Show Gist options
  • Save mgiuffrida/275571bae1e95a825c7c to your computer and use it in GitHub Desktop.
Save mgiuffrida/275571bae1e95a825c7c to your computer and use it in GitHub Desktop.
// option 1:
myPromise.then(
function(result) {
// do stuff
}, function(error) {
// oh noes
})
.then(
function(result) {
// continue doing stuff
}, function(error) {
// we is doomed
});
// option 2:
myPromise.then(function(result) {
// do stuff
}, function(error) {
// oh noes
}).then(function(result) {
// continue doing stuff
}, function(error) {
// we is doomed
});
// clang-format
myPromise.then(
function(result) {
// do stuff
},
function(error) {
// oh noes
})
.then(
function(result) {
// continue doing stuff
},
function(error) {
// we is doomed
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment