promise链式调用

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


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