Skip to content

Instantly share code, notes, and snippets.

@tbaba
Last active June 6, 2019 06:30
Show Gist options
  • Save tbaba/5f394c431e3102a8d735d4ef6a4a74e4 to your computer and use it in GitHub Desktop.
Save tbaba/5f394c431e3102a8d735d4ef6a4a74e4 to your computer and use it in GitHub Desktop.
非同期の実験
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