can.isDeferred

  • function
 

Deprecated 2.3.16

This method has been replaced by can.isPromise.

Check if an object is a Deferred.

can.isDeferred(subject)

Parameters

  1. subject {*}

    The object to check.

Returns

{Boolean}

Whether subject is a Deferred.

can.isDeferred returns if an object is an instance of can.Deferred.

Example

Convert any value to a Deferred:

function convertDeferred(dfd) {
    return can.isDeferred(dfd) ? dfd : can.Deferred(dfd);
}