📜  javascript代码示例中的承诺

📅  最后修改于: 2022-03-11 15:02:59.753000             🧑  作者: Mango

代码示例6
const myPromise = new Promise((resolve, reject) => {
  setTimeout(() => {
    resolve('foo');
  }, 300);
});

myPromise
  .then(handleResolvedA, handleRejectedA)
  .then(handleResolvedB, handleRejectedB)
  .then(handleResolvedC, handleRejectedC);