dojo/promise¶
authors: | Mark Wubben |
---|---|
since: | V1.8 |
Contents
dojo/promise is the package that manages promises, or in other words, communication between asynchronous threads.
Introduction¶
Promises are the programming concept that allow easier programming of non-blocking asynchronous code. The dojo/promise
module is Dojo’s implementation of the concept. The module is made up dojo/promise/Promise
and two helper modules dojo/promise/all
and
dojo/promise/first
. Related modules are dojo/Deferred
, dojo/when
and dojo/errors/CancelError
.
-
The abstract base class that defines Dojo Promises.
-
Takes multiple promises and returns a new promise that is fulfilled when all promises have been fulfilled.
-
Takes multiple promises and returns a new promise that is fulfilled when the first of the promises have been fulfilled.
See also¶
- Futures and Promises Wikipedia Article
- dojo/Deferred - The class for managing asynchronous threads.
- dojo/when - The module that allows seamless management of promises and other arbitrary values.
- dojo/errors/CancelError - Defines the default error that will be raised if a promise is canceled without a reason.