Skip to main content

Promise

Description

Promise object constructor

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

Parameters

  • executor - (required) function - a callback used to initialize the promise

Returns

  • promise - (object) - the promise object

Example

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

Details

Bluebird Promise object constructor, bundled with the Gantt library.