Skip to content

自己动手实现一个符合Promise A+ 规范的Promise

License

Notifications You must be signed in to change notification settings

AnaniZhu/DIY-Promise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DIY-Promise

自己动手实现一个符合 Promise A+ 规范的 Promise

1. 什么是 Promise

Promise 是 JS 异步编程中的重要概念,异步抽象处理对象,是目前比较流行 Javascript 异步编程解决方案之一。

2. 用途

避免回调地狱,优雅的异步编程方案

3. 功能

  • Promise.prototype.then()
  • Promise.prototype.catch()
  • Promise.prototype.finally()
  • Promise.resolve
  • Promise.reject
  • Promise.all
  • Promise.race
  • Promise.allSettled

4. 测试

npm run test
测试用例结果:

参考

About

自己动手实现一个符合Promise A+ 规范的Promise

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published