Skip to content

WuYifanX/promise

Repository files navigation

My Promise

使用TypeScript写的符合 Promise/A+ 标准的 promise.

How to use

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);

How to test

yarn test

Refernence

Promise的源码实现(完美符合Promise/A+规范)

Saber2pr Promise

About

promise in typescript

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published