Description: Determine the current state of a Deferred object.
The deferred.state() method returns a string representing the current state of the Deferred object. The Deferred object can be in one of three states:
deferred.resolve() or deferred.resolveWith() has been called for the object and the doneCallbacks have been called (or are in the process of being called). deferred.reject() or deferred.rejectWith() has been called for the object and the failCallbacks have been called (or are in the process of being called).This method is primarily useful for debugging to determine, for example, whether a Deferred has already been resolved even though you are inside code that intended to reject it.