My guess is no, but I won't swear it. You can accomplish at least part (if not all) of what you want without that functionality anyway.
You can always set things up to wait on multiple deferreds with $.when
. So, instead of
var dfd= $.Deferred();
dfd.done(foo).fail(bar);
You'd have
var dfd= $.Deferred();
var userfailedtointeract= $.Deferred();
$.when(dfd,userfailedtointeract).done(foo);
Which you'd resolve userfailedtointeract
after which point it's safe to call foo or reject otherwise
However, this does not take care of conditionally calling bar
, as adding the .fail(bar)
to the above $.when
line means bar
fires when either of the promises are rejected. You only want bar
to fire on failure only if userfailedtointeract
was resolved!
That leads us to the following:
var dfd= $.Deferred();
var userfailedtointeract= $.Deferred();
userfailedtointeract.done(function(){
dfd.done(foo).fail(bar);
});
Which... actually isn't a hard a solution as I thought it would be. But I'm looking at this with insomniac eyes. I might be missing something.