41

只会用就out了,手写一个符合规范的Promise

 5 years ago
source link: https://juejin.im/post/5b88df2a51882542e56e62c9
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Promise是什么 所谓Promise,简单说就是一个容器,里面保存着某个未来才会结束的事件(通常是一个异步操作)的结果。从语法上说,Promise 是一个对象,从它可以获取异步操作的消息。Promise 提供统一的 API,各种异步操作都可以用同样的方法进

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK