New to Kendo UI for AngularStart a free 30-day trial

Deferred

Deferred class similar to jQuery's Deferred.

Constructors

Deferred

()

Creates a new Deferred object.

Methods

notify

Notifies progress callbacks with the given value.

Parameters

value?

N

The value to pass to the progress callbacks.

progress

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.

promise

Returns the underlying Promise object.

Returns

Promise<T>

The Promise object.

reject

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.

resolve

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.

then

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.

In this article
ConstructorsDeferredMethods
Not finding the help you need?
Contact Support