Creates Promise instances.
Internal constructor. Do not call.
Static
allCreates promise which fulfills if all other promises are fulfilled. Or rejects if one of the promises rejects.
Iterable of Promise instances
Static
allCreates a promise that resolves after all of the given promises have either fulfilled or rejected, with an array of objects that each describes the outcome of each promise.
Static
anyPromise.any() takes an iterable of Promise objects and, as soon as one of the promises in the iterable fulfills, returns a single promise that resolves with the value from that promise. If no promises in the iterable fulfill (if all of the given promises are rejected), then the returned promise is rejected with an AggregateError, Essentially, this method is the opposite of Promise.all().
Static
isThis method tests if a given object is a promise. The algorithm will return true for:
Note: Because of support for dojo/Deferred any object with a 'then', 'isResolved' and 'isRejected' method is detected as a promise.
a potential promise.
true if candidate is a promise.
Static
raceCreates promise which fulfills if one of the other promises fulfills. Or rejects if one of the promises rejects.
Iterable of Promise instances
Creates promise which fulfills if one of the other promises fulfills. Or rejects if one of the promises rejects.
Static
rejectOptional
reason: anyThe reason the promise was rejected.
a promise in rejected state.
Static
resolveCreates a new resolved promise
Creates a new resolved promise with the given value
result object.
a promise in fulfilled state.
Static
trackAugments the given Promise with new state lookup functions.
Static
withProduces an object with a promise along with its resolution and rejection functions. Allows to resolve/reject the promise manually after creating it.
Static
wrapWraps e.g. dojo/Deferred or native Promise to this Promise class.
a promise
Registers an error handler.
Registers an error handler. Which is not called if the error is a Cancel instance.
Registers a handler, which is called in success or error state. But the handler is not able to change the result state!
Optional
handler: null | () => voidfunction invoked regardless of success or error
Registers success and/or error handlers.
this instance, augmented with augmented with:
Wrapper of global.Promise class. Read more about Promises.
See
https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Promise