Creates a Deferred
instance which represents a future value.
While a Promise
can only be resolved or rejected by calling the respective methods in its constructor, a Deferred
can be resolved or rejected via resolve
or reject
methods at any point. A Deferred
object creates a Promise
instance which functions as a proxy for the future result. This Promise
object can be accessed via the promise
property of the Deferred
object.