使用TypeScript写的符合 Promise/A+ 标准的 promise.
const promise = new Promise();
// Instance Methods
promise.then((resolve, reject)=>{
resolve(value);
})
promise.catch((reason)=>{
// deal with reason
})
// Static Methods:
Promise.resolve(value);
Promise.reject(reason);
Promise.race(promises);
Promise.all(promises);
yarn test