Last active
June 6, 2019 06:30
-
-
Save tbaba/5f394c431e3102a8d735d4ef6a4a74e4 to your computer and use it in GitHub Desktop.
非同期の実験
This file contains 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
const funcA = () => { | |
return Promise((resolve, reject) => { | |
resolve("funcA"); | |
}); | |
}; | |
const funcB = () => { | |
return Promise((resolve, reject) => { | |
resolve("funcB"); | |
}); | |
}; | |
const funcC = () => { | |
return Promise((resolve, reject) => { | |
resolve("funcC"); | |
}); | |
}; | |
return Promise.all([ | |
funcA, | |
funcB, | |
funcC | |
]).then(() => { | |
// 最終的な処理 | |
}).catch((error) => { | |
// 3つの中のどれかで reject があったらここ | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment