Description
The deferred.state() method determines 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:
- "pending": The Deferred object is not yet in a completed state (neither "rejected" nor "resolved")
- "resolved": The Deferred object is in the resolved state, meaning that either
deferred.resolve()
ordeferred.resolveWith()
has been called for the object and the doneCallbacks have been called (or are in the process of being called) - "rejected": The Deferred object is in the rejected state, meaning that either
deferred.reject()
ordeferred.rejectWith()
has been called for the object and the failCallbacks have been called (or are in the process of being called)
v1.7
This method has the form:
deferred.state()
Return Value
This form returns a String