can.isDeferred

  • function
 

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);
}