promise/js/resolver.js:1
Represents an asynchronous operation. Provides a
standard API for subscribing to the moment that the operation completes either
successfully (fulfill()
) or unsuccessfully (reject()
).
Promise.Resolver
promise
Defined in
promise/js/resolver.js:1
promise
Promise
The promise instance this resolver will be handling
_addCallbacks
[callback]
[errback]
Defined in
promise/js/resolver.js:178
Schedule execution of a callback to either or both of "resolve" and "reject" resolutions of this resolver. If the resolver is not pending, the correct callback gets called automatically.
_notify
subs
result
Defined in
promise/js/resolver.js:225
Executes an array of callbacks from a specified context, passing a set of arguments.
subs
Function[]
The array of subscriber callbacks
result
Any
Value to pass the callbacks
fulfill
value
Defined in
promise/js/resolver.js:60
Resolves the promise, signaling successful completion of the
represented operation. All "onFulfilled" subscriptions are executed and passed
the value provided to this method. After calling fulfill()
, reject()
and
notify()
are disabled.
value
Any
Value to pass along to the "onFulfilled" subscribers
getStatus
Defined in
promise/js/resolver.js:212
Returns the current status of the Resolver as a string "pending", "fulfilled", or "rejected".
reject
value
Defined in
promise/js/resolver.js:92
Resolves the promise, signaling unsuccessful completion of the
represented operation. All "onRejected" subscriptions are executed with
the value provided to this method. After calling reject()
, resolve()
and notify()
are disabled.
value
Any
Value to pass along to the "reject" subscribers
then
[callback]
[errback]
Defined in
promise/js/resolver.js:157
Schedule execution of a callback to either or both of "resolve" and
"reject" resolutions for the Resolver. The callbacks
are wrapped in a new Resolver and that Resolver's corresponding promise
is returned. This allows operation chaining ala
functionA().then(functionB).then(functionC)
where functionA
returns
a promise, and functionB
and functionC
may return promises.
The promise of a new Resolver wrapping the resolution of either "resolve" or "reject" callback
_status
Defined in
promise/js/resolver.js:38
The status of the operation. This property may take only one of the following values: 'pending', 'fulfilled' or 'rejected'.
Default: 'pending'