New to Kendo UI for Angular? Start a free 30-day trial
Deferred class similar to jQuery's Deferred.
()
Creates a new Deferred object.
|
---|
Notifies progress callbacks with the given value.
|
Parameters | | |
---|
value?
|
N
|
The value to pass to the progress callbacks.
|
|
|
---|
Adds a handler to be called when the Deferred object is notified of progress.
|
Parameters | | |
---|
callback
|
(value?: N) => void
|
A function to call when progress is notified.
|
|
Returns | |
---|
Deferred<T>
|
The Deferred object.
|
|
|
---|
Returns the underlying Promise object.
|
Returns | |
---|
Promise<T>
|
The Promise object.
|
|
|
---|
Rejects the Deferred object and calls any fail callbacks with the given reason.
|
Parameters | | |
---|
reason?
|
any
|
The reason for rejecting the promise.
|
|
Returns | |
---|
Deferred<T>
|
The Deferred object.
|
|
|
---|
Resolves the Deferred object and calls any done callbacks with the given value.
|
Parameters | | |
---|
value?
|
T
|
The value to resolve the promise with.
|
|
Returns | |
---|
Deferred<T>
|
The Deferred object.
|
|
|
---|
Attaches callbacks for the resolution, rejection, and progress of the Promise.
|
Parameters | | |
---|
onFulfilled?
|
(value: T) => TResult1 | PromiseLike<TResult1>
|
The callback to execute when the Promise is resolved.
|
onRejected?
|
(reason: any) => TResult2 | PromiseLike<TResult2>
|
The callback to execute when the Promise is rejected.
|
onProgress?
|
(value?: N) => void
|
The callback to execute when the Promise reports progress.
|
|
Returns | |
---|
Promise<TResult1 | TResult2>
|
A Promise for the completion of which ever callback is executed.
|
|