Promise 对象的构造函数
executor | function | 用于设置 promise 的回调函数 |
object | 返回生成的 promise 对象 |
new gantt.Promise(function(resolve, reject) {
setTimeout(function(){
resolve();
}, 5000);
}).then(function(){
alert("Resolved")
});
这是来自 Bluebird 的 Promise 对象构造函数,已包含在 Gantt 库中。
Back to top