Here is my main situation:
function somePostThing() { return $post("/someUrl").done(doSomething); } function doSomething(data) {
The last line may or may not work, because done
will not work if the deferred object is already allowed. I would like to be able to do something like this:
function doSomethingWithData(data) { // do stuff } var value; if (object.deferred.isResolved()) doSomethingWithData(object.deferred.value()); else object.deferred.done(doSomethingWithData);
How to get the value of jQuery.Deferred()
already resolved?
source share