Created
September 1, 2016 06:40
-
-
Save hjanuschka/a5dfc7b8bf0054a6e3afa3e332e0ca68 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Promise.resolve() | |
.then(a) | |
.then(b) | |
.then(c) | |
.then(d) | |
.then(e) | |
.then(f) | |
.then(function() { | |
console.log("FINAL") | |
}) | |
.catch(function(e) { | |
console.log("ERROR: " + e); | |
}); | |
function a() { | |
console.log("a"); | |
return Promise.resolve(); | |
} | |
function b() { | |
console.log("b") | |
return Promise.resolve(); | |
} | |
function c() { | |
console.log("c"); | |
//I want to skip all steps till "FINAL" | |
return Promise.reject(); | |
} | |
function d() { | |
console.log("d"); | |
return Promise.resolve(); | |
} | |
function e() { | |
console.log("e"); | |
return Promise.resolve(); | |
} | |
function f() { | |
console.log("f"); | |
return Promise.resolve(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment