jQuery deferred.state()
Method
Definition and Usage
The deferred.state()
function is used to determine the current state of a Deferred object.
Note: The deferred.state()
method returns a string representing the current state of the Deferred object. A Deferred object can be in one of three states:
"pending": The Deferred object is in the unresolved state.
"resolved": The Deferred object is in the resolved state, meaning that either
deferred.resolve()
ordeferred.resolveWith()
has been called and thedoneCallbacks
have been invoked (or are in the process of being invoked)."rejected": The Deferred object is in the rejected state, meaning that either
deferred.reject()
ordeferred.rejectWith()
has been called and thefailCallbacks
have been invoked (or are in the process of being invoked).
Syntax
This method does not accept any parameters.