public final class Deferred<Result,FailResponse> extends Object
Deferred<String, Error> deferred = RSVP.defer();
// ...
deferred.promise // access the promise
// ...
deferred.resolve("Hello");
The RSVP.Promise constructor is generally a better, less error-prone choice than RSVP.defer().
Promises are recommended unless the specific properties of deferred are needed.| Modifier and Type | Field and Description |
|---|---|
Promise<Result,FailResponse> |
promise
Returns the promise that is wrapped by this Deferred object.
|
| Modifier and Type | Method and Description |
|---|---|
void |
reject(FailResponse failValue)
Rejects this Deferred's underlying promise, passing the specified value to the reject handler of all
thenables chained to the promise
|
void |
resolve(Result value)
Resolves this Deferred's underlying promise, passing the specified value to all then thenables chained to
the promise
|
public Promise<Result,FailResponse> promise
public void resolve(Result value)
value - the value to be propagated to all chained thenablespublic void reject(FailResponse failValue)
failValue - the value to be propagated to the reject handlers of all chained thenablesCopyright © 2015. All Rights Reserved.