The function to be executed during the creation of the promise. Any errors thrown in the executor will cause the promise to be rejected. The return value of the executor is always ignored
Optional
timeout: numberOptional deadline timeout to wait before processing the items, defaults to undefined. If the number of milliseconds represented by this parameter has elapsed and the callback has not already been called, then a task to execute the callback is queued in the event loop (even if doing so risks causing a negative performance impact). timeout must be a positive value or it is ignored.
Creates an idle Promise instance that when resolved or rejected will execute it's pending chained operations asynchronously using the
requestIdleCallback
API (if available) with the optional provided timeout value to schedule when the chained items will be executed. WhenrequestIdleCallback
is not available this becomes the same ascreateAsyncPromise
which usessetTimeout
to schedule executions.