首页 > 其他 > 详细

promise链式调用

时间:2019-12-30 12:34:55      阅读:68      评论:0      收藏:0      [点我收藏+]
var that = this;
that.hello().then(res => { return that.world(res);
}).then(res => { console.log(res); }) function hello(){ var that = this; var p = new Promise((resolve,reject) => { resolve(‘hello ‘); }) return p; } function world(params){ var that = this; var p = new Promise((resolve, reject) => { resolve(`${params}world!`); }) return p; }


promise链式调用

原文:https://www.cnblogs.com/pycmsj/p/12118528.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!