61

应用Promise封装Ajax实践

 5 years ago
source link: https://juejin.im/post/5b699295e51d45199358f7b5
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.
引: axios在项目中经常使用,但有次面试让我把ajax封装成axios形式,当时居然没写出来。看来还是不能停留在使用的表层。 回来研究promise觉得也并不是很难,关键是掌握Promise A+规范以及Promise写法。先看看axios如何实现的。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK