reject

  • function
can.Deferred.prototype.reject  

Reject a Deferred.

deferred.reject([argument])

Parameters

  1. argument {Object}Optional

    The argument to call the failCallback with.

deferred.reject(args) rejects the Deferred object and calls the fail callbacks with the given arguments.

var def = can.Deferred();

def.fail(function(reason) {
  console.log("Failure! " + reason.foo); //-> Oh, no!
});
def.reject({ foo: 'Oh, no!' });