Перейти к основному содержимому

Promise

Description

Конструктор объекта Promise

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

Parameters

  • executor - (обязательный) function - обратный вызов, используемый для инициализации promise

Returns

  • promise - (object) - сам объект promise

Example

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

Details

Bluebird конструктор объекта Promise от Bluebird, поставляемый вместе с библиотекой 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.