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

Promise

Description

Конструктор для создания объекта Promise

Promise: (executor: SchedulerCallback) => any

Parameters

  • executor - (required) function - функция обратного вызова, которая инициализирует promise

Returns

  • promise - (object) - созданный объект promise

Example

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

Details

Это конструктор для объекта Promise.

Change log

  • Введено в версии v6.0.
  • С переходом с Bluebird на нативный Promise в версии v7.0.
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.