• function

rejectWith can.Deferred.prototype.rejectWith


Reject a Deferred in a particular context.

deferred.rejectWith(context[, arguments])


  1. context {Object}

    Context passed to the failCallbacks as the this object.

  2. arguments {Object}Optional

    Array of arguments that are passed to the failCallbacks.

deferred.rejectWith(context, arguments) rejects a Deferred and calls the failCallbacks with the given arguments.

var def = can.Deferred();
def.rejectWith(this, { error: "Animals are gone." })