跳到主要内容

Promise

Description

Promise 对象构造函数

Promise: new (executor: (resolve: (value?: any) => void, reject: (reason?: any) => void) => void) => Promise<unknown>

Parameters

  • executor - (required) function - 一个用于初始化 Promise 的回调函数

Returns

  • promise - (object) - 这个 Promise 对象

Example

new gantt.Promise(function(resolve, reject) {
setTimeout(function(){
resolve();
}, 5000);
}).then(function(){
alert("Resolved")
});

Details

Bluebird Promise 对象构造函数,与 Gantt 库一起打包。

Need help?
Got a question about the documentation? Reach out to our technical support team for help and guidance. For custom component solutions, visit the Services page.